Group Anagrams

Problem Group the anagrams in an array of strings; return the groups in any order.

Input / Output

  • Input: string[] strs. Output: list of anagram groups.

Constraints

  • Up to 10^4 strings of length <= 100; O(total chars) achievable.

Example

  • ["eat","tea","tan","ate","nat","bat"] → [["eat","tea","ate"],["tan","nat"],["bat"]].
asked …
LeaderboardSalaryAccount