Wildcard Matching
Problem Statement
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.Input: s = "cb", p = "?a"
Output: false
Explanation: '?' matches 'c', but the second letter is 'a', which does not match 'b'.Intuition
Links
Video Links
Approach 1:
Approach 2:
Approach 3:
Similar Problems
Last updated