master
Skye 2 years ago
parent 89fd3bed34
commit ec91ebd5b0
Signed by: me
GPG Key ID: 0104BC05F41B77B8

@ -1,8 +1,2 @@
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)
print(sum([(dict(zip(map(chr,(list(range(97,123))+list(range(65,91)))),range(1,53))))[((list(map(set,((line.strip())[:len((line.strip()))//2],(line.strip())[len((line.strip()))//2:])))[0])&(list(map(set,((line.strip())[:len((line.strip()))//2],(line.strip())[len((line.strip()))//2:])))[1])).pop()] for line in f.readlines()]))
Loading…
Cancel
Save