Trains the technique from
LeetCode 187Repeated DNA SequencesThis is an original problem, written from a brief that listed the technique, the difficulty, the topics, the function shape and the input bounds — none of that problem's wording, examples, hints or editorials. The link is there so you can map your practice onto the standard set.
Same function shape, different story and different numbers.
A strand reads s, a string over the four letters 'A', 'C', 'G' and 'T'.
Return every run of exactly ten letters that appears in the strand more than once, each run listed once, in the order they first appear.
Example 1
The run "GGTCAGGTCA" starts at both position 0 and position 5, so it comes round again. No other ten-letter run repeats.
Example 2
Two runs repeat here, and they are listed in the order they first appear.
Example 3
The strand is exactly ten letters long, so there is only one run and nothing can repeat.
The editor is preloaded with this. It matches the parent problem's shape, so a solution that works here transfers to a judge unchanged.
def find_repeated_dna_sequences(s: str) -> list[str]:public List<String> findRepeatedDnaSequences(String s)See the step-by-step animation, the intuition, and clean code in every language — free, no credit card.