451. Sort Characters By Frequency (Medium) 按照字符出现次数对字符串排序(leetcode排序)
题目: Input:
"tree"
Output:
"eert"
Explanation:
'e' appears twice while 'r' and 't' both appear once.
So 'e' must appear before both 'r' and 't'. Therefore "eetr" is also a valid answer.