题解 | #删除字符串中出现次数最少的字符#暴力求解不多mi
删除字符串中出现次数最少的字符
https://www.nowcoder.com/practice/05182d328eb848dda7fdd5e029a56da9?tpId=37&tags=&title=&difficulty=0&judgeStatus=0&rp=1&sourceUrl=%2Fexam%2Foj%2Fta%3FtpId%3D37
dic_str={} str=input() ls=list(str) ls_del=[] for iword in str: if iword not in dic_str: dic_str[iword]=1 else: dic_str[iword]+=1 min=999 for iword in dic_str: if dic_str[iword]<min: min=dic_str[iword] for key in dic_str: if dic_str[key]==min: ls_del.append(key) for index in range(-1,-1-len(ls),-1): if ls[index] in ls_del: del ls[index] ls.append('') a=''.join(ls) print(a)