Wildcard pattern matching


2 test cases are not passing

hello @vivekpatel
a) u have not intialised u base case properly.
image

b) image
here in place of true it should be dp[i-1][j-1]

c) add an else statement and in that do dp[i][j]=false

now only one case is giving run error

how to make solve this using one d array

if u observe
then ur dp[i][j] depends either on current row i,e i or previous row i.e i-1.
so instead of of using N*M matrix use 2 X M matrix

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.