求猿辅导笔试答案,我不会就提前交卷了

第二题,第三题答案?#猿辅导##笔试题目##题解#
全部评论
第二题挺简单的,第一题做了半天就是过不了,醉了 from collections import OrderedDict n,m = list(map(int,input().split())) nums = list(map(int,input().split())) hashmap = OrderedDict() for i in nums:     if i not in hashmap:         hashmap[i] = 1     else:         hashmap[i] += 1 result = hashmap.items() print(result) ans = list(filter(lambda x:x[1] <= m,result)) res = [] for i in ans:     for j in range(i[1]):         res.append(i[0]) res = map(str,res) print(' '.join(res))
点赞 回复 分享
发布于 2019-08-24 17:33
第一题你做出来了?
点赞 回复 分享
发布于 2019-08-24 17:32

相关推荐

评论
点赞
1
分享

创作者周榜

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