Given an input string (
s) and a pattern (
p), implement wildcard pattern
matching with support for
'?' Matches any single character.
'*' Matches any sequence of characters (including the empty sequence).
The matching should cover the entire input string (not partial).
s could be empty and contains only lowercase letters
p could be empty and contains only lowercase letters
a-z, and characters like
s = "aa"
p = "a"
Explanation: "a" does not match the entire string "aa".
s = "aa"
p = "*"
Explanation: '*' matches any sequence.
s = "cb"
p = "?a"
Explanation: '?' matches 'c', but the second letter is 'a', which does not match 'b'.
s = "adceb"
p = "*a*b"
Explanation: The first '*' matches the empty sequence, while the second '*' matches the substring "dce".
s = "acdcb"
p = "a*c?b"
Tags: String, Dynamic Programming, Backtracking, Greedy