Can someone explain this question i did not understand that

can someone explain this question i did not understand that

hi @Aditya-Kushwaha-914550392281281 we have to form a n-digit number with a, and b. Lets say n = 3. We can form 2^3, ie 8 numbers.
But we cannot have 2 “b” together. So all the possible configurations are :

aaa - valid
aab - valid
aba - valid
abb - not valid
baa - valid
bab - valid
bba - not valid
bbb - not valid

As you can see here, for n = 3, 5 numbers are of valid configuration, so the output should be 5.

You will be given a number of test cases, you have to tell the number of possible configurations for all testcases.

will u please give me a reference code actually now i understand the question but i could not able to code it

@Aditya-Kushwaha-914550392281281
Look for the hint video in the course. Or you can wait to solve this problem till you cover DP because that approach is needed here. There is a similar problem with the name “optimal binary strings” you can look for it’s hint also

I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.

On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.