medium
Repeated DNA Sequences
A DNA string is composed of the letters A, C, G and T. Given such a string, return every length-10 substring that appears more than once anywhere in the string.
Constraints
- 1 ≤ s.length ≤ 10^5
- s[i] ∈ {A, C, G, T}
Examples
in: s = "AAAAACCCCCAAAAACCCCCCAAAAAGGGTTT"
out: ["AAAAACCCCC", "CCCCCAAAAA"]
Code it yourself
Solve in
Test execution is not yet available for this exercise.Practice journal →Draft saved in this browser.
Hints:
Which approach applies?
Choose an approach to check your pattern recognition, or reveal the discussion when you need help.