mirror of
https://gitee.com/coder-xiaomo/leetcode-problemset
synced 2025-01-10 18:48:13 +08:00
26 lines
1.3 KiB
HTML
26 lines
1.3 KiB
HTML
<p>The <strong>DNA sequence</strong> is composed of a series of nucleotides abbreviated as <code>'A'</code>, <code>'C'</code>, <code>'G'</code>, and <code>'T'</code>.</p>
|
|
|
|
<ul>
|
|
<li>For example, <code>"ACGAATTCCG"</code> is a <strong>DNA sequence</strong>.</li>
|
|
</ul>
|
|
|
|
<p>When studying <strong>DNA</strong>, it is useful to identify repeated sequences within the DNA.</p>
|
|
|
|
<p>Given a string <code>s</code> that represents a <strong>DNA sequence</strong>, return all the <strong><code>10</code>-letter-long</strong> sequences (substrings) that occur more than once in a DNA molecule. You may return the answer in <strong>any order</strong>.</p>
|
|
|
|
<p> </p>
|
|
<p><strong class="example">Example 1:</strong></p>
|
|
<pre><strong>Input:</strong> s = "AAAAACCCCCAAAAACCCCCCAAAAAGGGTTT"
|
|
<strong>Output:</strong> ["AAAAACCCCC","CCCCCAAAAA"]
|
|
</pre><p><strong class="example">Example 2:</strong></p>
|
|
<pre><strong>Input:</strong> s = "AAAAAAAAAAAAA"
|
|
<strong>Output:</strong> ["AAAAAAAAAA"]
|
|
</pre>
|
|
<p> </p>
|
|
<p><strong>Constraints:</strong></p>
|
|
|
|
<ul>
|
|
<li><code>1 <= s.length <= 10<sup>5</sup></code></li>
|
|
<li><code>s[i]</code> is either <code>'A'</code>, <code>'C'</code>, <code>'G'</code>, or <code>'T'</code>.</li>
|
|
</ul>
|