Learn
Practice
Interview
Resources
Newsletter
F
Toggle theme
0
F
0
Toggle menu
Animations
← Back to All Animations
Rotate String
Bookmark
Brute Force
Concatenate
KMP
Input
Valid rotation
Not a rotation
Different lengths
Custom
s
=
abcde
,
goal
=
cdeab
s
a
b
c
d
e
goal
c
d
e
a
b
s
a
b
c
d
e
goal
c
d
e
a
b
s
a
b
c
d
e
goal
c
d
e
a
b
s
a
b
c
d
e
k
rotated
a
b
c
d
e
goal
c
d
e
a
b
s
a
b
c
d
e
k
rotated
a
b
c
d
e
goal
c
d
e
a
b
s
a
b
c
d
e
k
rotated
b
c
d
e
a
goal
c
d
e
a
b
s
a
b
c
d
e
k
rotated
b
c
d
e
a
goal
c
d
e
a
b
s
a
b
c
d
e
k
rotated
c
d
e
a
b
goal
c
d
e
a
b
s
a
b
c
d
e
k
rotated
c
d
e
a
b
goal
c
d
e
a
b
s
a
b
c
d
e
rotated
c
d
e
a
b
goal
c
d
e
a
b
goal is a rotation of s
algo
master
.
io
Step:
Start: check if "cdeab" is a rotation of "abcde"
0 / 8
Input
Valid rotation
Not a rotation
Different lengths
Custom
s
=
abcde
,
goal
=
cdeab
0 / 8
algo
master
.
io
Step:
Start: check if "cdeab" is a rotation of "abcde"