question samaj nhi aaya
kuch bhi nhi aaya samaj
Queation samaj nhi aaya
hi @anujsharmabadboy you will be given a number n, you have to make strings of length “n” such that, there are no consecutive 1’s, meaning that 1 cannot occur with another 1, it must be surrounded with 0 on both sides.
for eg for n = 3, the following strings can be formed
000 - valid
001 - valid
010 - valid
011 - not valid
100 - valid
101 - valid
110 - not valid
111 - not valid
As you can see from above, we can form 5 valid strings for n = 3, so we report 5 as the answer
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.