Given an input string s
and a pattern p
, implement regular expression matching with support for '.'
and '*'
:
'.'
Matches any single character.'*'
Matches zero or more of the preceding element.
The matching should cover the entire input string (not partial).
- Dynamic Programming
- Recursive Backtracking
- Pattern Matching
Input: s = "aa", p = "a"
Output: False
Input: s = "aa", p = "a*"
Output: True
Input: s = "mississippi", p = "mis*is*p*."
Output: False
def is_match(s: str, p: str) -> bool:
# Implement your solution here
pass