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

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

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

#-*- coding:utf-8 -*-

string = raw_input()
table = {}
for str in string:
	table[str] = table.get(str, 0) + 1

my_dict = {key: value for key, value in table.items() if value != min(table.values())}

output_list = ''
str_list = list(my_dict.keys())
for s in list(string):
	if s in str_list:
		output_list += s

print(output_list)

#每日靠近华为offer一步#
全部评论

相关推荐

我要娶个什么名:学长你电脑闹鬼了
点赞 评论 收藏
分享
10-30 16:31
重庆大学 Java
代码飞升_不回私信人...:你说你善于学习,大家都会说。你说你是985,985会替你表达一切
点赞 评论 收藏
分享
评论
点赞
收藏
分享

创作者周榜

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