Problem
Implement a tiny regular expression matcher. The pattern p contains lowercase letters plus two special characters:
- . matches any single character.
- * means zero or more of the preceding element.
Return true if p matches the entire string s (not just part of it).
Example 1
- Input
- s = "aa", p = "a"
- Output
- false
- Why
- only one a
Example 2
- Input
- s = "aa", p = "a*"
- Output
- true
Example 3
- Input
- s = "ab", p = ".*"
- Output
- true
- Why
- any characters, any number of times
Example 4
- Input
- s = "aab", p = "c*a*b"
- Output
- true
- Why
- zero c's, two a's, one b
Constraints
1 <= s.length <= 201 <= p.length <= 20s contains only lowercase letters; p contains lowercase letters, . and *.Every * comes right after a letter or ..