The idea is to use the fact that all anagrams, when sorted, result in the same string. Thus, by sorting each string in the input list and using the sorted string as the key in a hash map, we can group ...
Given an array of strings strs, group the anagrams together. You can return the answer in any order. There is no string in strs that can be rearranged to form "bat". The strings "nat" and "tan" are ...