题解 | #字符统计#
字符统计
https://www.nowcoder.com/practice/c1f9561de1e240099bdb904765da9ad0?tpId=37&tqId=21325&rp=1&ru=/exam/oj/ta&qru=/exam/oj/ta&sourceUrl=%2Fexam%2Foj%2Fta%3FtpId%3D37&difficulty=undefined&judgeStatus=undefined&tags=&title=102
from collections import defaultdict
s = input()
d = defaultdict(int)
for ch in s:
d[ch] += 1
dd = dict()
for k, v in d.items():
# print(k, v)
if d[k] not in dd:
dd[v] = k
else:
dd[v] = dd[v] + k
for k in sorted(dd, reverse=True):
print("".join(sorted(dd[k])), end="")
