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)/字符串轮转 [string-rotation-lcci].html

29 lines
774 B
HTML
Raw Normal View History

2022-03-27 20:38:29 +08:00
<p>字符串轮转。给定两个字符串<code>s1</code><code>s2</code>,请编写代码检查<code>s2</code>是否为<code>s1</code>旋转而成(比如,<code>waterbottle</code><code>erbottlewat</code>旋转后的字符串)。</p>
<p><strong>示例1:</strong></p>
<pre><strong> 输入</strong>s1 = &quot;waterbottle&quot;, s2 = &quot;erbottlewat&quot;
<strong> 输出</strong>True
</pre>
<p><strong>示例2:</strong></p>
<pre><strong> 输入</strong>s1 = &quot;aa&quot;, s2 = &quot;aba&quot;
<strong> 输出</strong>False
</pre>
<ol>
</ol>
<p><strong>提示:</strong></p>
<ol>
<li>字符串长度在[0, 100000]范围内。</li>
</ol>
<p><strong>说明:</strong></p>
<ol>
<li>你能只调用一次检查子串的方法吗?</li>
</ol>