mirror of
https://gitee.com/coder-xiaomo/leetcode-problemset
synced 2025-09-13 19:31:42 +08:00
add leetcode problem-cn part5
This commit is contained in:
@@ -0,0 +1,42 @@
|
||||
<p>把字符串 <code>s</code> 看作是 <code>“abcdefghijklmnopqrstuvwxyz”</code> 的无限环绕字符串,所以 <code>s</code> 看起来是这样的:</p>
|
||||
|
||||
<ul>
|
||||
<li><code>"...zabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcd...."</code> . </li>
|
||||
</ul>
|
||||
|
||||
<p>现在给定另一个字符串 <code>p</code> 。返回<em> <code>s</code> 中 <strong>唯一</strong> 的 <code>p</code> 的 <strong>非空子串</strong> 的数量 </em>。 </p>
|
||||
|
||||
<p> </p>
|
||||
|
||||
<p><strong>示例 1:</strong></p>
|
||||
|
||||
<pre>
|
||||
<strong>输入:</strong> p = "a"
|
||||
<strong>输出:</strong> 1
|
||||
<strong>解释:</strong> 字符串 s 中只有一个"a"子字符。
|
||||
</pre>
|
||||
|
||||
<p><strong>示例 2:</strong></p>
|
||||
|
||||
<pre>
|
||||
<strong>输入:</strong> p = "cac"
|
||||
<strong>输出:</strong> 2
|
||||
<strong>解释:</strong> 字符串 s 中的字符串“cac”只有两个子串“a”、“c”。.
|
||||
</pre>
|
||||
|
||||
<p><strong>示例 3:</strong></p>
|
||||
|
||||
<pre>
|
||||
<strong>输入:</strong> p = "zab"
|
||||
<strong>输出:</strong> 6
|
||||
<strong>解释:</strong> 在字符串 s 中有六个子串“z”、“a”、“b”、“za”、“ab”、“zab”。
|
||||
</pre>
|
||||
|
||||
<p> </p>
|
||||
|
||||
<p><strong>提示:</strong></p>
|
||||
|
||||
<ul>
|
||||
<li><code>1 <= p.length <= 10<sup>5</sup></code></li>
|
||||
<li><code>p</code> 由小写英文字母构成</li>
|
||||
</ul>
|
Reference in New Issue
Block a user