You are viewing a single comment's thread. Return to all comments →
#python names=sorted([input().lower() for x in range(int(input()))]) queries=[input().lower() for x in range(int(input()))] for x in queries: s=0 for y in x: s+=abs(ord(y)-ord('a')+1) print(s*(names.index(x)+1))
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 →