Tap here to switch tabs
Problem
Submissions

Problem: Repeated DNA Sequences

Repeated DNA Sequences asks you to find every distinct DNA substring of exactly 10 letters that occurs more than once in a given sequence.

Statement

A DNA sequence consists of a series of nucleotides, each represented by one of the characters 'A', 'C', 'G', or 'T'.

Given a string s representing a DNA sequence, find and return all 1010-letter-long substrings that appear more than once within s. The result may be returned in any order.

Constraints:

  • 1≤1 \leq s.length ≤105\leq 10^5

  • s[i] is one of 'A', 'C', 'G', or 'T'

⋮
Tap here to switch tabs
Problem
Submissions

Problem: Repeated DNA Sequences

Repeated DNA Sequences asks you to find every distinct DNA substring of exactly 10 letters that occurs more than once in a given sequence.

Statement

A DNA sequence consists of a series of nucleotides, each represented by one of the characters 'A', 'C', 'G', or 'T'.

Given a string s representing a DNA sequence, find and return all 1010-letter-long substrings that appear more than once within s. The result may be returned in any order.

Constraints:

  • 1≤1 \leq s.length ≤105\leq 10^5

  • s[i] is one of 'A', 'C', 'G', or 'T'