题解 | #众数#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])
众数
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])
相关推荐
李橙子:结果虽不够理想,但过程本身已是宝贵的淬炼。能把学习机会放在薪酬之前,证明你目光长远。先踏实进去,用这段时间扎实学好Python后端,把公司项目吃透,你的价值会在下一份工作中完全体现。这个起点,值得。