
Sponsored
Sponsored
Use these hints if you're stuck. Try solving on your own first.
As we can only delete characters, if we have multiple characters having the same frequency, we must decrease all the frequencies of them, except one.
Sort the alphabet characters by their frequencies non-increasingly.
Iterate on the alphabet characters, keep decreasing the frequency of the current character until it reaches a value that has not appeared before.