44. Wildcard Matching
Last updated
Was this helpful?
Last updated
Was this helpful?
Given an input string (s
) and a pattern (p
), implement wildcard pattern matching with support for '?'
and '*'
.
'?' 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 or contains only lowercase letters a-z
.
p
could be empty or contains only lowercase letters a-z
, and characters like ?
or *
.
Input: s = "aa", p = "a"
Output: false
Explanation: "a" does not match the entire string "aa".
Count the Number of matching characters in a pair of strings -