Guidewire interview question

group all anagram strings together