题解 | #删除字符串中出现次数最少的字符#
删除字符串中出现次数最少的字符
https://www.nowcoder.com/practice/05182d328eb848dda7fdd5e029a56da9
s = input().strip() strMap = {} for i in s: if i in strMap: strMap[i] += 1 else: strMap[i] = 1 for kv in strMap: if strMap[kv] == min(strMap.values()): s = s.replace(kv, "") print(s)