Not passing 2 test cases


What is wrong in the code? How can I correct that??

Hello @J19APPPP0007,

There are multiple issues with your program:

  1. if n=1, then there are 2 strings possible of length one
    0,1

  2. The answer can be a value greater than the range of int.
    Thus, make dp[] of type long long int.
    Also, modify the return type of function to long

I have modified your code:

Hope, this would help.
Give a like, if you are satisfied.