Group Anagrams
Given an array of strings strs, group the anagrams together. Return an array of groups. The order of the groups and of words within a group doesn't matter for the tests below (they sort before comparing), what matters is the grouping.
The key insight: two words are anagrams iff their sorted letters are identical, so a sorted-string key buckets them.
groupAnagrams(["eat", "tea", "tan", "ate", "nat", "bat"]);
// [["eat","tea","ate"], ["tan","nat"], ["bat"]] (in some order)