class Solution: def repeatedDNA(self, DNA: str) -> List[str]: result = [] n = len(DNA) for i in range(n - 9): substring = DNA[i:i+10] if substring in DNA[i+1:] and substring not in result: result.append(substring) return result