题解 | #字符统计#用sorted套娃
字符统计
http://www.nowcoder.com/practice/c1f9561de1e240099bdb904765da9ad0
while True:
try:
str_input = input()
new_list = list(set(str_input))
str_dict = {}
for c in new_list:
str_dict[c] = str_input.count(c)
res_list = sorted(sorted(str_dict.items(), key=lambda x : x[0]), key=lambda y: y[1], reverse=True)
result = ''
for i in res_list:
result += i[0]
print(result)
except:
break