Class Assignment Problem

Can you please give me some hint

Hello @bhattanurag426
i think you should approaching it in the correct way actually there are 2 ways in which i have done this question one is the fibonacci way and the other is the way which we can do by DP.
In the dp way we will check for the recusrion calls and then there we will also check if there are not two consecutive b’s if there are 2 consecutive b’s then we will send the a in the recusrion call and otherwise we will make two recursion calls for the both ‘a’ and ‘b’.
Here for your reference i am attaching both the codes.



if you have any douby in any of the way doing then you can ask here:
Happy Learning!!

can you explain fibonacci way also

@bhattanurag426 there is nothing of explaining it is just i have observed the pattern that the answers are in this format. so i have coded in that way.
it is forming the fibonacci pattern.

ok sir got it…

@bhattanurag426 do you have any other doubt or is your doubt cleared?

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.