aoc/2020/06/06_minimal.py

5 lines
230 B
Python
Raw Normal View History

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))