题解 | #删除字符串中出现次数最少的字符#
删除字符串中出现次数最少的字符
https://www.nowcoder.com/practice/05182d328eb848dda7fdd5e029a56da9
def remove(s): a = {} a = {} for i in s: if i not in a.keys(): a[i] = 1 else: a[i] = a[i] + 1 for k,v in a.items(): if v == min(a.values()): for j in range(v): s.remove(k) return s s = list(input()) print(''.join(remove(s)))
 查看21道真题和解析
查看21道真题和解析 投递阿里云等公司10个岗位
投递阿里云等公司10个岗位