Learn
Practice
Interview
Resources
Newsletter
F
Toggle theme
0
F
0
Toggle menu
Animations
← Back to All Animations
Permutation in String
Bookmark
Brute Force
Frequency Compare
Match Count
Input
Example 1
Example 2
Example 3
No Match
Custom
s1
=
ab
,
s2
=
eidbaooo
s1
a
b
e
i
d
b
a
o
o
o
0
1
2
3
4
5
6
7
s1
a
b
e
i
d
b
a
o
o
o
0
1
2
3
4
5
6
7
s1
a
b
tried
0
/ 2
e
i
d
b
a
o
o
o
0
1
2
3
4
5
6
7
generate all
2
permutations, search each in s2
s1
a
b
tried
1
/ 2
e
i
d
b
a
o
o
o
0
1
2
3
4
5
6
7
perms
ab
is
"ab"
in s2?
no
s1
a
b
tried
2
/ 2
e
i
d
b
a
o
o
o
0
1
2
3
4
5
6
7
perms
ab
ba
"ba"
is in s2 at [3..4]
return
true
window [3..4]
algo
master
.
io
Step:
Start of algorithm
0 / 3
Input
Example 1
Example 2
Example 3
No Match
Custom
s1
=
ab
,
s2
=
eidbaooo
0 / 3
algo
master
.
io
Step:
Start of algorithm