Group Anagrams

Medium · Hashing · about 15 minutes

Asked at Amazon, Meta, Uber, Bloomberg.

Given an array of lowercase strings strs, group the anagrams together — words made of the same letters with the same counts. Return the groups in any order; the words inside a group may be in any order too.

Related guides