Not able to implement recursion in binary strings


do we have to extract the last bit and what is the input format??

hello @rastogi.g1998
your base case is wrong.

for n=1 answer should be 2 ( either 1 or 0 , both are correct)

if u are putting 0 for n==0 ,then u need to add more base case i,e if n==2 then return 3. (00,01,10)
rest evrthing is correct.

i cant tell u input format , as i dont have problem link .
if u have the pls check it input section for input format

its (count binary strings of length of N,which have NO consecutive ones ?

it is not an exercise its just conceptual video with a hint and this much only

check ur dp assignment, this question might be mentioned there.

i am currently doing recursion

no issue, for input format u can refer that

thank you sir i understood if n==1 it can either be 1 or 0 so return 2,if n==0,we already have 0 so return 0

thank you sir i was trying to think with other codes perspective forgetting about this aspect thank you