Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit c95612f

Browse files
committed
Added README.md file for Rotate String
1 parent 44960f3 commit c95612f

File tree

1 file changed

+23
-0
lines changed

1 file changed

+23
-0
lines changed

‎812-rotate-string/README.md

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
<h2><a href="https://leetcode.com/problems/rotate-string">Rotate String</a></h2> <img src='https://img.shields.io/badge/Difficulty-Easy-brightgreen' alt='Difficulty: Easy' /><hr><p>Given two strings <code>s</code> and <code>goal</code>, return <code>true</code> <em>if and only if</em> <code>s</code> <em>can become</em> <code>goal</code> <em>after some number of <strong>shifts</strong> on</em> <code>s</code>.</p>
2+
3+
<p>A <strong>shift</strong> on <code>s</code> consists of moving the leftmost character of <code>s</code> to the rightmost position.</p>
4+
5+
<ul>
6+
<li>For example, if <code>s = &quot;abcde&quot;</code>, then it will be <code>&quot;bcdea&quot;</code> after one shift.</li>
7+
</ul>
8+
9+
<p>&nbsp;</p>
10+
<p><strong class="example">Example 1:</strong></p>
11+
<pre><strong>Input:</strong> s = "abcde", goal = "cdeab"
12+
<strong>Output:</strong> true
13+
</pre><p><strong class="example">Example 2:</strong></p>
14+
<pre><strong>Input:</strong> s = "abcde", goal = "abced"
15+
<strong>Output:</strong> false
16+
</pre>
17+
<p>&nbsp;</p>
18+
<p><strong>Constraints:</strong></p>
19+
20+
<ul>
21+
<li><code>1 &lt;= s.length, goal.length &lt;= 100</code></li>
22+
<li><code>s</code> and <code>goal</code> consist of lowercase English letters.</li>
23+
</ul>

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /