This commit is contained in:
Sebastian Seedorf
2022-12-05 09:30:05 +01:00
parent b8fcf3a685
commit 9da1101818
4 changed files with 329 additions and 0 deletions

12
day03/part2.py Normal file
View File

@@ -0,0 +1,12 @@
#!/usr/bin/env python3
from itertools import chain, islice
lines = (x.strip() for x in open("input.txt"))
s = 0
for line1, line2, line3 in (chain([first], islice(lines, 2)) for first in lines):
i = set(line1).intersection(line2).intersection(line3)
o = ord(i.pop())
s += o - 0x60 if o > 0x60 else o - 38
print(s)