1
0
mirror of https://gitee.com/coder-xiaomo/leetcode-problemset synced 2025-01-11 02:58:13 +08:00
Code Issues Projects Releases Wiki Activity GitHub Gitee
leetcode-problemset/leetcode-cn/problem (Chinese)/不同的循环子字符串 [distinct-echo-substrings].html

33 lines
1.1 KiB
HTML
Raw Normal View History

2022-03-27 20:37:52 +08:00
<p>给你一个字符串&nbsp;<code>text</code> ,请你返回满足下述条件的&nbsp;<strong>不同</strong> 非空子字符串的数目:</p>
<ul>
<li>可以写成某个字符串与其自身相连接的形式(即,可以写为 <code>a&nbsp;+ a</code>,其中 <code>a</code> 是某个字符串)。</li>
</ul>
<p>例如,<code>abcabc</code>&nbsp;就是&nbsp;<code>abc</code>&nbsp;和它自身连接形成的。</p>
<p>&nbsp;</p>
<p><strong>示例 1</strong></p>
<pre><strong>输入:</strong>text = &quot;abcabcabc&quot;
<strong>输出:</strong>3
<strong>解释:</strong>3 个子字符串分别为 &quot;abcabc&quot;&quot;bcabca&quot;&quot;cabcab&quot;
</pre>
<p><strong>示例 2</strong></p>
<pre><strong>输入:</strong>text = &quot;leetcodeleetcode&quot;
<strong>输出:</strong>2
<strong>解释:</strong>2 个子字符串为 &quot;ee&quot;&quot;leetcodeleetcode&quot;
</pre>
<p>&nbsp;</p>
<p><strong>提示:</strong></p>
<ul>
<li><code>1 &lt;= text.length &lt;= 2000</code></li>
<li><code>text</code>&nbsp;只包含小写英文字母。</li>
</ul>