Given an input string s and a pattern p, implement regular expression matching with support for '.' and '*'. This is a classic hard memoization problem because the same suffix states are reached many times.
s = text string, p = pattern with '.' and '*'
true if s matches p, otherwise false
Example 1:
Input:
s = "aa" p = "a*"
Output:
true
Explanation:
'*' allows multiple 'a' characters.
Example 2:
Input:
s = "ab" p = ".*"
Output:
true
Explanation:
'.*' can match any string.