Sort by Frequency
Medium · rating 1400 · Hashing, Sorting, Strings
Read a string of lowercase letters. Print its characters sorted by descending frequency; break ties by the character (ascending).
For tree print eert (ties broken by character).
Constraints: 1 ≤ length ≤ 105
Related problems
- Count Anagram Groups — Medium
- Keypad Taps — Medium
- Election Winner — Medium
- Intersection of Two Arrays — Medium
- Longest Substring Without Repeats — Medium
- First Unique Character — Medium