mirror of
https://gitee.com/coder-xiaomo/leetcode-problemset
synced 2025-01-11 02:58:13 +08:00
33 lines
1.1 KiB
HTML
33 lines
1.1 KiB
HTML
|
<p>给你一个字符串 <code>text</code> ,请你返回满足下述条件的 <strong>不同</strong> 非空子字符串的数目:</p>
|
|||
|
|
|||
|
<ul>
|
|||
|
<li>可以写成某个字符串与其自身相连接的形式(即,可以写为 <code>a + a</code>,其中 <code>a</code> 是某个字符串)。</li>
|
|||
|
</ul>
|
|||
|
|
|||
|
<p>例如,<code>abcabc</code> 就是 <code>abc</code> 和它自身连接形成的。</p>
|
|||
|
|
|||
|
<p> </p>
|
|||
|
|
|||
|
<p><strong>示例 1:</strong></p>
|
|||
|
|
|||
|
<pre><strong>输入:</strong>text = "abcabcabc"
|
|||
|
<strong>输出:</strong>3
|
|||
|
<strong>解释:</strong>3 个子字符串分别为 "abcabc","bcabca" 和 "cabcab" 。
|
|||
|
</pre>
|
|||
|
|
|||
|
<p><strong>示例 2:</strong></p>
|
|||
|
|
|||
|
<pre><strong>输入:</strong>text = "leetcodeleetcode"
|
|||
|
<strong>输出:</strong>2
|
|||
|
<strong>解释:</strong>2 个子字符串为 "ee" 和 "leetcodeleetcode" 。
|
|||
|
</pre>
|
|||
|
|
|||
|
<p> </p>
|
|||
|
|
|||
|
<p><strong>提示:</strong></p>
|
|||
|
|
|||
|
<ul>
|
|||
|
<li><code>1 <= text.length <= 2000</code></li>
|
|||
|
<li><code>text</code> 只包含小写英文字母。</li>
|
|||
|
</ul>
|