message: Update repeated-dna-sequences.py
diff: # Time: O(n)
  # Space: O(n)
  -#
  +
  # All DNA is composed of a series of nucleotides abbreviated as A, C, G, and T,
  # for example: "ACGAATTCCG". When studying DNA, it is sometimes useful to identify repeated sequences within the DNA.
  #
  #
  # Return:
  # ["AAAAACCCCC", "CCCCCAAAAA"].
  -import collections
  +import collections
  -class Solution:
  - # @param s, a string
  - # @return a list of strings
  +class Solution(object):
  def findRepeatedDnaSequences(self, s):
  + """
  + :type s: str
  + :rtype: List[str]
  + """
  dict, rolling_hash, res = {}, 0, []
  for i in xrange(len(s)):
  - rolling_hash = rolling_hash << 3 & 0x3fffffff | ord(s[i]) & 7
  + rolling_hash = ((rolling_hash << 3) & 0x3fffffff) | (ord(s[i]) & 7)
  if rolling_hash not in dict:
  dict[rolling_hash] = True
  elif dict[rolling_hash]:
  @@ -41,6 +43,7 @@ class Solution:
  l.extend([s[i:i + 10]])
  return [k for k, v in collections.Counter(l).items() if v > 1]
  +
  if __name__ == "__main__":
  print Solution().findRepeatedDnaSequences("AAAAAAAAAA")
  print Solution().findRepeatedDnaSequences("")
  