题解 | #字符统计#
字符统计
http://www.nowcoder.com/practice/c1f9561de1e240099bdb904765da9ad0
python3
while True: try: strs = input() new_str = set(strs) res = {} for i in new_str: count_i = strs.count(i) if count_i not in res: res[count_i] = [i] else: res[count_i].append(i) res[count_i] = sorted(res[count_i],key=lambda x:ord(x)) result = sorted(res.items(),key=lambda k :k[0],reverse=True) print(''.join(''.join(i[1]) for i in result)) except: break