Group anagrams
hardDictionaries40 XP
Group the words that are anagrams of each other (same letters, any order). Sort the words inside each group alphabetically, then sort the groups by their first word.
Examples
- Input: words = ["eat", "tea", "tan", "ate", "nat", "bat"]Output: [["ate", "eat", "tea"], ["bat"], ["nat", "tan"]]
Examples use JSON: true/false/null are True/False/None in Python.