Learn
Practice
Interview
Resources
Newsletter
F
Toggle theme
0
F
0
Toggle menu
Animations
← Back to All Animations
Group Anagrams
Bookmark
Sorting
Frequency Count
Prime Hashing
Input
Example 1
Example 2
Custom
strs
=
[eat, tea, tan, ate, nat, bat]
words
eat
tea
tan
ate
nat
bat
words
eat
tea
tan
ate
nat
bat
words
eat
tea
tan
ate
nat
bat
i
sorted =
a
e
t
→
aet
words
eat
tea
tan
ate
nat
bat
i
groups
{aet}
eat
words
eat
tea
tan
ate
nat
bat
i
sorted =
a
e
t
→
aet
groups
{aet}
eat
tea
words
eat
tea
tan
ate
nat
bat
i
sorted =
a
n
t
→
ant
groups
{aet}
eat
tea
{ant}
words
eat
tea
tan
ate
nat
bat
i
sorted =
a
e
t
→
aet
groups
{aet}
eat
tea
{ant}
tan
words
eat
tea
tan
ate
nat
bat
i
groups
{aet}
eat
tea
ate
{ant}
tan
words
eat
tea
tan
ate
nat
bat
i
sorted =
a
n
t
→
ant
groups
{aet}
eat
tea
ate
{ant}
tan
nat
words
eat
tea
tan
ate
nat
bat
i
sorted =
a
b
t
→
abt
groups
{aet}
eat
tea
ate
{ant}
tan
nat
{abt}
words
eat
tea
tan
ate
nat
bat
groups
{aet}
eat
tea
ate
{ant}
tan
nat
{abt}
bat
3 groups found
algo
master
.
io
Step:
Start: group words that are anagrams of each other
0 / 27
Input
Example 1
Example 2
Custom
strs
=
[eat, tea, tan, ate, nat, bat]
0 / 27
algo
master
.
io
Step:
Start: group words that are anagrams of each other