I’m going to guess n log n.
Because you can first sort the letters first which is n log n. Then you have to compare each pair of letters in the new sorted list. That adds n-1 operations.
Giving a total of (n-1) + (n log n).
The (n-1) becomes less important as n grows, so it can be ignored.