one liner
This commit is contained in:
parent
89fd3bed34
commit
ec91ebd5b0
1 changed files with 1 additions and 7 deletions
8
3.py
8
3.py
|
@ -1,8 +1,2 @@
|
||||||
with open("input3.txt") as f:
|
with open("input3.txt") as f:
|
||||||
a = dict(zip(map(chr,(list(range(97,123))+list(range(65,91)))),range(1,53)))
|
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()]))
|
||||||
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)
|
|
Loading…
Reference in a new issue