Implement a function that checks whether an input string matches a wildcard pattern.
?
matches
exactly one
character.
*
matches
any sequence
of characters, including the empty sequence.
s
p
true
if
s
matches
p
entirely (not a substring match), otherwise
false
.
s = "aa"
,
p = "a"
→
false
s = "aa"
,
p = "*"
→
true
s = "cb"
,
p = "?a"
→
false
s = "adceb"
,
p = "*a*b"
→
true
0 ≤ len(s), len(p) ≤ 2000