Leetcode451 Sort Characters By Frequency
Given a string, sort it in decreasing order based on the frequency of characters.Example 1:Input:"tree"Output:"eert"本题就是要把字符串里的数字按频率降序输出。注意题目中说,频率相同的字母顺序随便排都是合理答案。一看次数,直接想到哈希表,所以我用了map...