not accepted
class Solution:
def isMatch(self, s: str, p: str) -> bool:
i=0
j=0
while j<len(p):
if i==len(s):
return True
if p[j]==s[i] or p[j]==".":
i+=1
j+=1
if i>0:
if p[j]=="*" and s[i]==s[i-1]:
i+=1
j+=1
return False
网友评论