Advertisement
Guest User

Untitled

a guest
Dec 15th, 2018
63
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.49 KB | None | 0 0
  1. class Solution:
  2. def findRepeatedDnaSequences(self, s):
  3. """
  4. :type s: str
  5. :rtype: List[str]
  6. """
  7. if len(s) <= 10:
  8. return []
  9. out_lst = set()
  10. charDict = set()
  11. for i in range(9, len(s)):
  12. sub_str = s[i-9:i+1]
  13. len(sub_str)
  14. if sub_str in charDict:
  15. out_lst.add(sub_str)
  16. else:
  17. charDict.add(sub_str)
  18. return list(out_lst)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement