Wildcard Matching
'?' Matches any single character.
'*' Matches any sequence of characters (including the empty sequence).
The matching should cover the entire input string (not partial).Input:
s = "aa"
p = "a"
Output: false
Explanation: "a" does not match the entire string "aa".Input:
s = "aa"
p = "*"
Output: true
Explanation: '*' matches any sequence.Analysis
Solution
Last updated