Wildcard Pattern Matching

Can you please explain the problem in detail and also how to approach this one?

Case 1: The character is ‘*’
Here two cases arise

We can ignore ‘ ’ character and move to next character in the Pattern.
‘ ’ character matches with one or more characters in Text. Here we will move to next character in the string.
Case 2: The character is ‘?’
We can ignore current character in Text and move to next character in the Pattern and Text.

Case 3: The character is not a wildcard character
If current character in Text matches with current character in Pattern, we move to next character in the Pattern and Text. If they do not match, wildcard pattern and Text do not match.

Can you please give a detailed explanation with a test case…

Can you please give a detailed explanation with a test case…


explanation of the question

Coding Blocks Online IDE | Run and check your code

this is a classic 2D DP problem, I have added that solution with comments, you can go through it and it passes all the TC as well