题解 | #名字的漂亮度#
名字的漂亮度
http://www.nowcoder.com/practice/02cb8d3597cf416d9f6ae1b9ddc4fde3
def main(word): abc = 'abcdefghijklmnopqrstuvwxyz' data = {} for i in abc: data[i] = word.count(i) count_list = sorted(data.values()) num = 0 for i in range(26): num += count_list[i] * (i+1) print(num) num = int(input()) for i in range(num): main(input())