题解 | #字符统计#
字符统计
https://www.nowcoder.com/practice/c1f9561de1e240099bdb904765da9ad0
import sys str=input() dic=dict() set=set(str) a=list(set) a.sort() for i in set: dic[i]=str.count(i) for j in range(max(dic.values()),-1,-1): for i in a: if dic[i]==j: print(i,end='')