Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class Solution:
- def findRepeatedDnaSequences(self, s):
- """
- :type s: str
- :rtype: List[str]
- """
- if len(s) <= 10:
- return []
- out_lst = set()
- charDict = set()
- for i in range(9, len(s)):
- sub_str = s[i-9:i+1]
- len(sub_str)
- if sub_str in charDict:
- out_lst.add(sub_str)
- else:
- charDict.add(sub_str)
- return list(out_lst)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement