Group Anagrams
Medium๐ท๏ธ Hashing๐ Hash Maps & Sets
๐งฉ The problem
Group words that are anagrams of each other. Return the groups sorted: words inside each group alphabetically, and groups by their first word.
Examples
["eat","tea","tan","ate","nat","bat"] โ [["ate","eat","tea"],["bat"],["nat","tan"]]
๐ฏ Aim for: O(n ยท k log k) time for n words of length k
โ๏ธ Write your solution
Pick a language, press Run to try it, then Run tests to check it against every test case โ just like a coding interview.