2020-02-28 Day6 Leetcode: 10. Re

2020-02-28  本文已影响0人  YueTan

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
上一篇 下一篇

猜你喜欢

热点阅读