This commit is contained in:
Sebastian Seedorf
2020-12-06 14:00:44 +01:00
parent 110c9fd125
commit 91bfe88097
3 changed files with 2120 additions and 0 deletions

21
day06/part2.py Normal file
View File

@@ -0,0 +1,21 @@
lines = (set([c for c in x.strip()]) for x in open("input.txt"))
current = set()
count = 0
restart = True
for line in lines:
if len(line) == 0:
count += len(current)
current = set()
restart = True
continue
if restart:
current = line
restart = False
else:
current = current.intersection(line)
count += len(current)
print(count)