Count Number Of binary strings

Can we solve this problem using dynamic programming?

hi @Sfo_2302 it can be solved using DP
the rec relation will be
f(n) = f(n-1) + f(n-2)
base case:
f(1) = 2
f(2) = 3

not getting the right answer

@Sfo_2302 please share your code using CB IDE

not getting the right answer the

please see carefully that i have send the link already when i asked the doubt.


Please refer to this link.