题解 | #字符统计#

字符统计

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

import sys
table1 = {}
for line in sys.stdin:
    a = line.strip()
    for i in a:
        if i not in table1:
            table1[i] = 1
        else:
            table1[i] +=1
    re1 = sorted(table1.items(), key=lambda x:(x[1],-ord(x[0])), reverse=True)
    for i in re1:
        print(i[0],end='')
    

全部评论

相关推荐

头像
07-01 18:39
已编辑
门头沟学院 Java
白火同学:我刚出学校那会沟通过最逆天的公司是一家初创公司,老板亲自在BOSS上当HR,说初创公司人没多少,前期比较艰苦,运维实施前后端都得干。问工资有多少,答两千,给技术入股。我寻思我饭都吃不起了,你跟我谈股份。
我的求职精神状态
点赞 评论 收藏
分享
HR岗的
投递菜鸟集团等公司10个岗位
点赞 评论 收藏
分享
评论
点赞
收藏
分享

创作者周榜

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