← All problems

Group Anagrams

MediumHash Map

Given an array of strings, group the anagrams together. Return groups in any order.

Examples

Input: ["eat","tea","tan","ate","nat","bat"]
Output: [["eat","tea","ate"],["tan","nat"],["bat"]]

Hints

Solution

Language:
Loading editor…
Output0 lines
Run your code to see output here.
Click Run all tests to check your solution against 3 test cases.