please clear ,e problem statement i am not able to understand the test case…give me some other test case wih explanation…
Wildcard matching problem dp
hello @shampblocks
consider this example
abcdefc
a*f?
we need to tell whether the given pattern match with input pattern or not.
some constraint that r given
* -> it can match with any number of characters
? -> it can match with any one character.
input - >abcdefc
pattern-> a*f?
abcdefc a *f?
a of input matched with a of pattern .
abcdefc a*f?
bcde of input matched with * of pattern
abcdefc a*f?
f of input matched with f of pattern
abcdefc a*f ?
c of input matched with ? of pattern
so this string is matched with the given pattern
so sequence should be same??..
yeah sequence must be same
is there any video of this problem of coding blocks??
I dont know,
check ur dynamic programming playlist for the same
this is not a tough question .
approach is more like LCS so thing a bit u will get the logic
in playlist there is no video of this problem may be its in webinar or somewhere else thats why asking for fast search
i have tried want to see video to get other approaches …
i guess it is not present .
Hello sir can you tell your approach to solve this problem…
Each occurrence of ‘?’ character in wildcard pattern can be replaced with any other character and each occurrence of ‘*’ with a sequence of characters such that the wildcard pattern becomes identical to the input string after replacement.
Let’s consider any character in the pattern.
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.
We can use Dynamic Programming to solve this problem – Let T[i][j] is true if first i characters in given string matches the first j characters of pattern.
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.