题解 | 删除字符串中出现次数最少的字符
删除字符串中出现次数最少的字符
https://www.nowcoder.com/practice/05182d328eb848dda7fdd5e029a56da9
from collections import Counter
a = input()
temp = Counter(a)
min1 = min(temp.values())
l = []
for i in temp:
if temp[i] == min1:
l.append(i)
result = []
for i in a:
if i not in l:
result.append(i)
print("".join(result))
查看10道真题和解析

