题解 | #字符统计#
字符统计
https://www.nowcoder.com/practice/c1f9561de1e240099bdb904765da9ad0
text = list(input()) text.sort() word = {} temp = [] for i in text: word[i] = text.count(i) for k, v in word.items(): temp.append((k, v)) temp.sort(key=lambda x: x[1], reverse=True) for j in temp: print(j[0], end="")