题解 | #名字的漂亮度#
名字的漂亮度
http://www.nowcoder.com/practice/02cb8d3597cf416d9f6ae1b9ddc4fde3
while True:
try:
n = int(input())
num=[i for i in range(26,0,-1)]
for i in range(n):
lst=input()
dic={}
result =0
for w in lst:
if w in dic:
dic[w]+=1
else:
dic[w]=1
t=0
dic_new = sorted(dic.values(),reverse=True)
for item in dic_new:
result += item*num[t]
t+=1
print(result)
except:
break