题解 | #删除字符串中出现次数最少的字符#
删除字符串中出现次数最少的字符
http://www.nowcoder.com/practice/05182d328eb848dda7fdd5e029a56da9
while True: try: want_list = list(input()) char_list = list(set(want_list)) temp_list = [] for each_char in char_list: temp_list.append(want_list.count(each_char)) min_count = min(temp_list) min_char_list = [] for each_char in char_list: if want_list.count(each_char) == min_count: min_char_list.append(each_char) new_list = [] for index in range(0, len(want_list)): if want_list[index] not in min_char_list: new_list.append(want_list[index]) res = "".join(new_list) print(res) except EOFError: break