Sponsored
Sponsored
Use these hints if you're stuck. Try solving on your own first.
Map the most frequent letters so that you can type them with only 1 keypress.
Use an array to keep track of the frequency of every character, then sort it in non-increasing order.