mirror of
https://gitee.com/coder-xiaomo/leetcode-problemset
synced 2025-09-02 22:13:28 +08:00
update
This commit is contained in:
32
leetcode-cn/problem (Chinese)/旋转字符串 [rotate-string].html
Normal file
32
leetcode-cn/problem (Chinese)/旋转字符串 [rotate-string].html
Normal file
@@ -0,0 +1,32 @@
|
||||
<p>给定两个字符串, <code>s</code> 和 <code>goal</code>。如果在若干次旋转操作之后,<code>s</code> 能变成 <code>goal</code> ,那么返回 <code>true</code> 。</p>
|
||||
|
||||
<p><code>s</code> 的 <strong>旋转操作</strong> 就是将 <code>s</code> 最左边的字符移动到最右边。 </p>
|
||||
|
||||
<ul>
|
||||
<li>例如, 若 <code>s = 'abcde'</code>,在旋转一次之后结果就是<code>'bcdea'</code> 。</li>
|
||||
</ul>
|
||||
|
||||
<p> </p>
|
||||
|
||||
<p><strong>示例 1:</strong></p>
|
||||
|
||||
<pre>
|
||||
<strong>输入:</strong> s = "abcde", goal = "cdeab"
|
||||
<strong>输出:</strong> true
|
||||
</pre>
|
||||
|
||||
<p><strong>示例 2:</strong></p>
|
||||
|
||||
<pre>
|
||||
<strong>输入:</strong> s = "abcde", goal = "abced"
|
||||
<strong>输出:</strong> false
|
||||
</pre>
|
||||
|
||||
<p> </p>
|
||||
|
||||
<p><strong>提示:</strong></p>
|
||||
|
||||
<ul>
|
||||
<li><code>1 <= s.length, goal.length <= 100</code></li>
|
||||
<li><code>s</code> 和 <code>goal</code> 由小写英文字母组成</li>
|
||||
</ul>
|
Reference in New Issue
Block a user