1
0
mirror of https://gitee.com/coder-xiaomo/leetcode-problemset synced 2025-02-04 14:40:27 +08:00
Code Issues Projects Releases Wiki Activity GitHub Gitee
leetcode-problemset/leetcode-cn/problem (Chinese)/环绕字符串中唯一的子字符串 [unique-substrings-in-wraparound-string].html

43 lines
1.5 KiB
HTML
Raw Normal View History

2023-12-09 18:42:21 +08:00
<p>定义字符串&nbsp;<code>base</code>&nbsp;为一个&nbsp;<code>"abcdefghijklmnopqrstuvwxyz"</code>&nbsp;无限环绕的字符串,所以&nbsp;<code>base</code>&nbsp;看起来是这样的:</p>
2022-03-27 20:52:13 +08:00
<ul>
2023-12-09 18:42:21 +08:00
<li><code>"...zabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcd...."</code>.</li>
2022-03-27 20:52:13 +08:00
</ul>
2023-12-09 18:42:21 +08:00
<p>给你一个字符串&nbsp;<code>s</code> ,请你统计并返回&nbsp;<code>s</code>&nbsp;中有多少&nbsp;<strong>不同</strong><strong>非空子串</strong>&nbsp;也在&nbsp;<code>base</code>&nbsp;中出现。</p>
2022-03-27 20:52:13 +08:00
<p>&nbsp;</p>
2023-12-09 18:42:21 +08:00
<p><strong>示例&nbsp;1</strong></p>
2022-03-27 20:52:13 +08:00
<pre>
2023-12-09 18:42:21 +08:00
<strong>输入:</strong>s = "a"
<strong>输出:</strong>1
<strong>解释:</strong>字符串 s 的子字符串 "a" 在 base 中出现。
2022-03-27 20:52:13 +08:00
</pre>
2023-12-09 18:42:21 +08:00
<p><strong>示例 2</strong></p>
2022-03-27 20:52:13 +08:00
<pre>
2023-12-09 18:42:21 +08:00
<strong>输入:</strong>s = "cac"
<strong>输出:</strong>2
<strong>解释:</strong>字符串 s 有两个子字符串 ("a", "c") 在 base 中出现。
2022-03-27 20:52:13 +08:00
</pre>
2023-12-09 18:42:21 +08:00
<p><strong>示例 3</strong></p>
2022-03-27 20:52:13 +08:00
<pre>
2023-12-09 18:42:21 +08:00
<strong>输入:</strong>s = "zab"
<strong>输出:</strong>6
<strong>解释:</strong>字符串 s 有六个子字符串 ("z", "a", "b", "za", "ab", and "zab") 在 base 中出现。
2022-03-27 20:52:13 +08:00
</pre>
<p>&nbsp;</p>
2023-12-09 18:42:21 +08:00
<p><strong>提示:</strong></p>
2022-03-27 20:52:13 +08:00
<ul>
2023-12-09 18:42:21 +08:00
<li><code>1 &lt;= s.length &lt;= 10<sup>5</sup></code></li>
<li><font color="#c7254e" face="Menlo, Monaco, Consolas, Courier New, monospace"><span style="font-size: 12.6px; background-color: rgb(249, 242, 244);">s</span></font> 由小写英文字母组成</li>
2022-03-27 20:52:13 +08:00
</ul>