题解 | #删除字符串中出现次数最少的字符#
删除字符串中出现次数最少的字符
https://www.nowcoder.com/practice/05182d328eb848dda7fdd5e029a56da9
s = input() w = '' count = 999 for i in s: str_count = s.count(i) if str_count < count: count = str_count l = [] l.append(i) elif str_count == count: l.append(i) for i in s: for j in set(l): if i == j: break else: w+=i if __name__ == "__main__": print(w)