10. Regular Expression Matching
class Solution:
def isMatch(self, s: str, p: str) -> bool:
i = 0
j = 0
while i < len(s) and j < len(p):
if s[i] == p[j] or p[j] == '.':
i += 1
j += 1
else:
return False
return i == j自頂向下
自底向上
TODO
Last updated