You are viewing a single comment's thread. Return to all comments →
100% python code
n = int(input()) names = list(sorted([input() for _ in range(n)])) q = int(input()) alphabet = "ABCDEFGHIJKLMNOPQRSTUVWXYZ" for _ in range(q): name = input() value = 0 for letter in name: value += alphabet.index(letter) + 1 value *= (names.index(name) + 1) print(value)
Seems like cookies are disabled on this browser, please enable them to open this website
Project Euler #22: Names scores
You are viewing a single comment's thread. Return to all comments →
100% python code