Untitled

 avatar
unknown
python
3 years ago
519 B
10
Indexable
import string

# del 1
print(sum([dict(zip(string.ascii_letters, [l for l in range(1,53)])).get(''.join(set(y[0]).intersection(y[1]))) for y in [[x[i:i + round(len(x) / 2)] for i in range(0, len(x), round(len(x) / 2))] for x in open('input.txt').read().split('\n') if x]]))

# --------------------------

# del 2
print(sum([dict(zip(string.ascii_letters, [l for l in range(1,53)])).get(''.join(set(y[0]).intersection(*y))) for y in list(zip(*[iter([x for x in open('input.txt').read().split('\n') if x])]*3))]))
Editor is loading...