please provide me how to approach this problem
I cant think of this problem
hey @arpit.jain22june
Output pattern is fibonacci
say a is 0 and b is 1
Now we need to form numbers with no consecutive ones.
So for n=1 we can form 0 or 1 so ans =2
for n=2 we can form 0+(0,1) or 1+(0) = 3
for n=3 we can form 00+(0,1) or 10+(0,1) or 01+(1) =5
and so on
so 2,3,5,8,13,…
So u just have to print the Fibonacci number for each test case
Precompute the Fibonacci numbers in array.
if this solves your doubt please mark it as resolved 