#testcase 5 not working

you need to include the following statements in your code

for (int j = 1; j <= a_len; j++)
if (a[j - 1] == ‘*’)
dp[0][j] = dp[0][j - 1];

you should include this after the statement
dp[0][0] = 1;

You need to include these because ‘*’ can match with empty string, for all the *s, that occur in the starting, dp[0][j] should be set to 1, like if the pattern is ***abc dp[0][0] dp[0][1] and dp[0][2] should be set to 1, because *s can match empty strings.

1 Like

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.