题解 | #名字的漂亮度#
名字的漂亮度
https://www.nowcoder.com/practice/02cb8d3597cf416d9f6ae1b9ddc4fde3
N = int(input()) for i in range(N): s = input().lower() d = {} for i in s: if i not in d: d[i] = s.count(i) ss = sorted(d.values(),reverse=True) pld = 0 for k in range(len(ss)): pld += (26-k)*ss[k] print(pld)