题解 | #众数#Python真是太优雅了

众数

https://www.nowcoder.com/practice/1549bbe3d8f546f888f4290250d9e2a6

from collections import Counter
print(sorted(Counter(map(int, input().split())).items(), key=lambda x: (-x[1], x[0]))[0][0])

全部评论

相关推荐

点赞 评论 收藏
分享
Aurora23:属于挂一半,暂时进池子了,隔一段时间没有其他组捞的话就彻底结束了
点赞 评论 收藏
分享
评论
1
收藏
分享

创作者周榜

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