题解 | #删除字符串中出现次数最少的字符#
删除字符串中出现次数最少的字符
https://www.nowcoder.com/practice/05182d328eb848dda7fdd5e029a56da9
astr = input() record = {achr:astr.count(achr) for achr in astr} min_num = min(record.values()) remove_list = [key for key in record.keys() if record[key]==min_num] # print(remove_list) for achr in remove_list: astr = astr.replace(achr, '') print(astr)