Optimize a naive recursive solution for string matching problems using memoization or bottom-up dynamic programming.
Implement is_match(text, pattern), where ? matches exactly one character and * matches zero or more characters. Matching must consume the entire input string and the entire pattern.
text and pattern are strings. Return True only when the complete strings match, otherwise return False.
def is_match(text, pattern):