Count number of binary strings

I’m not getting the correct output. I’ve tried the fibonacci series approach using top down dp

hello @prashantverma.vn
a) thre is a mistake in base case.
if n==1 then answer should be 2.

b) use long long for dp array and function return type

I’ve corrected my mistakes, now two test cases are failing on submit.

image
make it long long

1 Like