I am not able to understand the question. Could you please explain the sample test cases?
Question not clear
Ai and Bi can be anything(fixed). Let’s say 0 and 1 or 1 and 2 or you can assume anything.
now you need to count distinct n digit numbers with no consecutive bi.
Eg n=3. (assuming 0 and 1 for explaining)
000 (valid)
001 (valid)
010 (valid)
011 (invalid)
100 (valid)
101 (valid)
110 (invalid)
111 (invalid)
These are all possible n digit numbers out of which 5 are valid( no consecutive 1’s)
Isn’t this question same as “Count no of binary strings” question?