题解 | #名字的漂亮度#
名字的漂亮度
https://www.nowcoder.com/practice/02cb8d3597cf416d9f6ae1b9ddc4fde3
num = int(input()) for _ in range(num): pom_str = input() ll = [] for l in set(pom_str): ll.append(pom_str.count(l)) ll = sorted(ll,reverse=True) print(sum([(26-i)*c for i,c in enumerate(ll)]))