题解 | #字符统计#
字符统计
https://www.nowcoder.com/practice/c1f9561de1e240099bdb904765da9ad0
import sys table1 = {} for line in sys.stdin: a = line.strip() for i in a: if i not in table1: table1[i] = 1 else: table1[i] +=1 re1 = sorted(table1.items(), key=lambda x:(x[1],-ord(x[0])), reverse=True) for i in re1: print(i[0],end='')