Files
python-aoc-2020/day06/part2.py
Sebastian Seedorf 91bfe88097 Day 6
2020-12-06 14:00:44 +01:00

22 lines
399 B
Python

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)