We’re preparing your current view and syncing the latest data.
A DNA sequence is composed of a string of characters 'A', 'C', 'G', and 'T'. Given a string s that represents a DNA sequence, return all the 10-letter-long sequences (substrings) that occur more than once in the string. The sequences can appear anywhere in s, and you must find every substring of length 10 that occurs at least twice.
A single string s representing the DNA sequence.
An array of strings where each string is a 10-letter substring occurring more than once.
1 <= s.length <= 10^5; s[i] is one of 'A', 'C', 'G', 'T'.
Example 1
Input
AAAAACCCCCAAAAACCCCCCAAAAAGGGTTT
Output
AAAAACCCCC,CCCCCAAAAA
Explanation
The 10-letter sequences 'AAAAACCCCC' and 'CCCCCAAAAA' appear twice in the input string.