题解 | #删除字符串中出现次数最少的字符#

删除字符串中出现次数最少的字符

https://www.nowcoder.com/practice/05182d328eb848dda7fdd5e029a56da9

while True:
    try:
        array = input()
        dic = {}
        for c in array:
            dic[c] = dic.get(c, 0) + 1
        min_values = min(dic.values())
        print("".join(x for x in array if dic[x] != min_values))
    except:
        break

全部评论

相关推荐

点赞 评论 收藏
分享
永不遗忘:才这么点算什么拉黑,我初筛连着挂几十次了,最后还是能进面
点赞 评论 收藏
分享
评论
点赞
收藏
分享

创作者周榜

更多
牛客网
牛客企业服务