Wildcard pattern Matching problem

What should be the size of DP array ? I think that is creating problem. Or is there any flaw in my logic ?
Code link: https://ide.codingblocks.com/s/160831

Hello @raj.bmp.333,

Yes, the size of your array is causing the issue.
I have corrected it:


But that is not the only issue:
It is failing for the test cases like:

  1. abc
    **
  2. abc
    ???

Correct your code for these.

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

This is giving Run time error.

My code is working on the test cases you mentioned. The only problem I think is with the size as constraints on size of individual strings is not mentioned.

Hey @raj.bmp.333,

  1. I have already corrected the issue with size by using the dynamic array.

  2. The only error is for the case:
    abc
    **
    It is causing run-time error because of the out of bound access of the dp array.
    That i have removed also.
    https://ide.codingblocks.com/s/160966

But, it is still giving wrong output for the above case, try to fix it.
Try hard. If you fail to do so, let me know.

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.