# @return a boolean
def isMatch(self, s, p):
pattern = re.compile("^" + p + "$")
if pattern.search(s) is None:
using the re module.
this is a veryshort-cuted method
some solutions are called cheating. :)
Looks like your connection to LeetCode Discuss was lost, please wait while we try to reconnect.