aoc/2020/06/06_minimal.py
2020-12-10 17:11:17 -06:00

5 lines
230 B
Python

with open("input.txt","r") as f:
groups = f.read().split('\n\n')
sets = [list(map(set, group.split('\n'))) for group in groups]
reduce = lambda fn: sum(len(fn(*s)) for s in sets)
print(reduce(set.union), reduce(set.intersection))