题解 | #删除字符串中出现次数最少的字符#
删除字符串中出现次数最少的字符
https://www.nowcoder.com/practice/05182d328eb848dda7fdd5e029a56da9
a = input() ss = 100 for i in a: if a.count(i) <= ss: ss = a.count(i) for i in a: if a.count(i) == ss: a = a.replace(i,"") print(a)
删除字符串中出现次数最少的字符
https://www.nowcoder.com/practice/05182d328eb848dda7fdd5e029a56da9
a = input() ss = 100 for i in a: if a.count(i) <= ss: ss = a.count(i) for i in a: if a.count(i) == ss: a = a.replace(i,"") print(a)
相关推荐