The pattern p may contain ? (matches any single character) and * (matches any sequence of characters, including an empty one). Return True if p matches the whole string s.
For s = "aa" and p = "*" the answer is True; for s = "cb" and p = "?a" it is False.
The starter code tries every length for every star. It is correct but too slow with many stars.
Example 1
Input:
is_match_wildcard('aa', '*')
Output:
True
Example 2
Input:
is_match_wildcard('cb', '?a')
Output:
False
0 <= len(s), len(p) <= 1000s has lower-case letters; p has lower-case letters, ? and *.No results yet
Run your code to check it against the examples, or submit to run every test.