S
All challenges
Practice
Home
Blog
Practice
Examples
Feedback
Group Anagrams
00:00
Start
00:00
Sign in
Problem
Hints
3
Solution
History
Medium
Array
HashMap
String
Sorting
Amazon
Google
Group an array of strings into lists of anagrams. Return the groups in any order.
Examples
Example 1
Input →
['eat','tea','tan','ate','nat','bat']
Output →
[['eat','tea','ate'],['tan','nat'],['bat']]
Example 2
Input →
['']
Output →
[['']]
Example 3
Input →
['a']
Output →
[['a']]
JavaScript
Python
Java (Coming soon)
C (Coming soon)
C++ (Coming soon)
Reset
Run
Submit
Cases
Results