题解 | 字符统计
字符统计
https://www.nowcoder.com/practice/c1f9561de1e240099bdb904765da9ad0
arr = list(input()) set_arr = set(arr) ll = [] for i in set_arr: ll.append([i,arr.count(i),ord(i)]) sort_ll = sorted(ll,key=lambda x:[-x[1],x[2]]) res = '' for i in sort_ll: res += i[0] print(res)