Simple algorithm to group anagrams