题解 | #字符统计#
字符统计
http://www.nowcoder.com/practice/c1f9561de1e240099bdb904765da9ad0
while True:
try:
s, d = input(), {}
for i in s:
d[i] = d.get(i, 0) + 1
print("".join([k for k, _ in sorted(d.items(), key=lambda x: (-x[1], x[0]))]))
except:
break