题解 | #删除字符串中出现次数最少的字符#
删除字符串中出现次数最少的字符
https://www.nowcoder.com/practice/05182d328eb848dda7fdd5e029a56da9
s1=input() se1=set(s1) li2=list(se1) #print(li2) li=[] for i in se1: n=0 for j in s1 : if i==j: n+=1 li.append(n) min1=min(li) #print(min1) li1=[] dic1={k:v for k,v in zip(li2,li)} #print(dic1) for i in dic1.items(): if i[1]==min1: li1.append(i[0]) for i in li1: s1=s1.replace(i,'') print(s1)