You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

8 lines
286 B

2 years ago
with open("input3.txt") as f:
a = dict(zip(map(chr,(list(range(97,123))+list(range(65,91)))),range(1,53)))
s = 0
for line in f.readlines():
line = line.strip()
d, f = map(set,(line[:len(line)//2],line[len(line)//2:]))
s += a[(d&f).pop()]
print(s)