What is the problem with my code?

code link: https://ide.codingblocks.com/s/178786

Hello @siddharth9k9,

There is a logical error in your code:
// 1 is the binary string of length 1 that ends with 1
// dp[1][1] = 0;
Solution:
dp[1][1] = 1;

Modified Code:

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

have you done these questions before

Yes @siddharth9k9,

May I know the reason of asking this?

Just curious nothing else.

Fair enough @siddharth9k9,

Please mark this doubt as resolved if you don’t have anything else to ask.
:slightly_smiling_face: