def findRepeatedDnaSequences(s): dix={s[:10]: 1} for i, c in enumerate(s[10:], 10): sub=s[i-9: i+1] if sub in dix: dix[sub]+=1 else: dix[sub]=1 return [ s for s in dix if dix[s]>1]