aoc/06/06_minimal.py
2020-12-06 16:00:49 -06:00

8 lines
303 B
Python

with open("input.txt","r") as f:
groups = f.read().split('\n\n')
print(
(
sum(len(set.union(*map(set, group.splitlines()))) for group in groups), # you can just call set() directly on string, no need to call list()
sum(len(set.intersection(*map(set, group.splitlines()))) for group in groups)
)
)