题解 | #字符统计#

字符统计

https://www.nowcoder.com/practice/c1f9561de1e240099bdb904765da9ad0

s = input()
dic = {}
for i in s:
    if i not in dic:
        dic[i] = 1
    else:
        dic[i] += 1
sortdic = sorted(sorted(dic.items(), key = lambda x:x[0]), key = lambda y:y[1], reverse = True)
#print(sortdic)
result = ''
for i in sortdic:
    result += i[0]
print(result)

全部评论

相关推荐

豆泥🍀:同26届,加油,我也还没找到查看图片
点赞 评论 收藏
分享
点赞 评论 收藏
分享
评论
点赞
收藏
分享

创作者周榜

更多
牛客网
牛客企业服务