Modified SortAnagrams