Let binary[n] be total ways for size n.
I am having 2 cases:
- if starts with 1 then next should be 0
- if starts with 0 next can be anything
Therefore
binary[n]= binary[n-1] +binary[n-2]
So why am I getting wrong answer in my code.
Where am I wrong?
Please help.
Thank you in Advance