Given an integer n, find the number of valid ternary strings of length n (using characters '0', '1', '2') such that no two consecutive '0's appear and no three consecutive '1's appear together.
You've read your 3 free write-ups
Sign up free to keep reading. Your account opens the first 10 questions of every company.