Why waste time sorting all of the strings in problem 13.1? Wouldn’t it be better to use the number of occurrences of each letter in the alphabet as a unique identifier for each anagram group? i.e, associate each string with a 26-element array of integers where A[0] is the number of occurrences of the letter ‘a’, etc.
Thanks,
Kevin