Count number of binary strings


wrong output , where is it wrong

refer this https://ide.codingblocks.com/s/590141

ok, but whats wrong in this approach

how can u explicitly pass count_strings(n,0) 0 as last digit over here… also there are many overlapping subproblems so u would have to use dynamic programming to avoid tle


check this , test cases are failing due to wrong output

try using long long int


still test cases are failing .

image
make this return also long long int… it will pass all test cases

done… thanku so much

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.