Given a string s, sort it in decreasing order based on the frequency of characters.
The frequency of a character is the number of times it appears in the string. Return the sorted string.
sInput: "tree" Output: "eert"
Input: "cccaaa" Output: "cccaaa"
Input: "Aabb" Output: "bbAa"
If multiple characters have the same frequency, their relative order does not matter.
No submissions yet.
Discuss hash maps, bucket sort, and sorting by frequency techniques.