Tell me about solving a recursive coding challenge that requires optimized time and space complexity.
Implement is_match(s, p) to determine whether the entire string s matches pattern p, where . matches any single character and * matches zero or more occurrences of the preceding element. Use recursion with memoization and return a boolean.
s contains lowercase English lettersp contains lowercase English letters, . and ** always follows a valid preceding pattern elementdef is_match(s, p):