题解 | #字符统计#
字符统计
http://www.nowcoder.com/practice/c1f9561de1e240099bdb904765da9ad0
n = input() st = dict() for x in n: st[x]=st.get(x,0)+1 st = sorted(st.items(),key=lambda x:(x[1],-ord(x[0])),reverse=True) print(''.join([s[0] for s in st]))
字符统计
http://www.nowcoder.com/practice/c1f9561de1e240099bdb904765da9ad0
n = input() st = dict() for x in n: st[x]=st.get(x,0)+1 st = sorted(st.items(),key=lambda x:(x[1],-ord(x[0])),reverse=True) print(''.join([s[0] for s in st]))
相关推荐