题解 | #删除字符串中出现次数最少的字符#
删除字符串中出现次数最少的字符
https://www.nowcoder.com/practice/05182d328eb848dda7fdd5e029a56da9
#整体思路:1.每个字符出现的次数统计,2.最小次数是多少,3.逐一判断,取掉出现最小次数的字符 a=input() c={} for i in set(a): c[i]=a.count(i) r=sorted(c.values())[0] for i in c.items(): if i[1]==r: a=a.replace(i[0],'') print(a)