Anagram regrouping