My code is giving wrong answer

please review my code and tell me what I have missed
my code https://ide.codingblocks.com/s/260109

Actually your DP recurrence is incorrect!
This problem is identical to number of binary strings of length n having no consecutive ones.
Think this way-> if n digits are not yet complete, then you can place a here, you can also place b here if previous digit is not b.

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.