题解 | #众数#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])

全部评论

相关推荐

菜菜狗🐶:双非之光
找工作,你会甘心进小厂还...
点赞 评论 收藏
分享
评论
1
收藏
分享

创作者周榜

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