187. 重复的DNA序列

class Solution:
    def findRepeatedDnaSequences(self, s: str) -> List[str]:
        begin = 0
        end = 9
        tmp = set()
        res = set()
        for end in range(end, len(s)):
            #print(s)
            new = s[begin:end + 1]
            #print(s[0:9])
            if new in tmp:
               
                res.add(new)
            tmp.add(new)
            begin += 1
            end = begin + 9
        return list(res)    
©️2020 CSDN 皮肤主题: 游动-白 设计师:上身试试 返回首页