题解 | #字符统计#

字符统计

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='')

全部评论

相关推荐

05-29 09:02
门头沟学院 Java
点赞 评论 收藏
分享
07-09 15:55
门头沟学院 Java
点赞 评论 收藏
分享
评论
点赞
收藏
分享

创作者周榜

更多
牛客网
牛客网在线编程
牛客网题解
牛客企业服务