What is wrong in the code? How can I correct that??
Not passing 2 test cases
Hello @J19APPPP0007,
There are multiple issues with your program:
-
if n=1, then there are 2 strings possible of length one
0,1 -
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.