题解 | #名字的漂亮度#
名字的漂亮度
https://www.nowcoder.com/practice/02cb8d3597cf416d9f6ae1b9ddc4fde3
N = int(input()) ls = [] for i in range(N): ls.append(list(input().upper())) for l in ls: lset = set(l) counts = [] for word in lset: counts.append(l.count(word)) counts.sort(reverse=True) sum = 0 for i in range(len(counts)): sum += (26 - i) * counts[i] print(sum)