题解 | #删除字符串中出现次数最少的字符#
删除字符串中出现次数最少的字符
https://www.nowcoder.com/practice/05182d328eb848dda7fdd5e029a56da9
s=input() lenth_s=len(s) a=[] b='' for i in range(lenth_s): a.append(s.count(s[i])) a=sorted(a) min=a[0]#找到最小值 for i in range(lenth_s): if s.count(s[i])>min: b+=s[i]#注意这里要用到字符串的加法 print(b)