题解 | #名字的漂亮度#
名字的漂亮度
http://www.nowcoder.com/practice/02cb8d3597cf416d9f6ae1b9ddc4fde3
from collections import Counter
while True:
try:
n = int(input())
for _ in range(n):
res = 0
lst = list(input())
cnt = Counter(lst)
a = sorted(cnt.values(),reverse=True)
for index, num in enumerate(a):
res+= num*(26-index)
print(res)
except:
break