题解 | #删除字符串中出现次数最少的字符#
删除字符串中出现次数最少的字符
https://www.nowcoder.com/practice/05182d328eb848dda7fdd5e029a56da9
##最大的困难是调试不方便
import sys
import re
from collections import Counter
b=[]
for line in sys.stdin:
a = line.strip()
a=''.join(re.findall('[a-z]',a))
if a!='':
b.append(a)
b=''.join(b)
# print(b)
c=Counter(b)
# print(c)
min_val=min(list(c.values()))
# print(min_val)
letter_to_be_removed=[i for i in c.keys() if c[i]==min_val]
# print(letter_to_be_removed)
for i in letter_to_be_removed:
b=b.replace(i,'')
print(b)