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.

11 lines
309 B

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