In the image I do not understand where the extra O(s) comes from when the array of strings are being sorted. I get that sorting the array of string will be O(a log a), I can't understand why we have to add in O(s) as well.
In my mind, O(a log a) has taken care of sorting off all the strings in the array of strings.