aoc2020/06/2.py
2020-12-06 12:21:23 +00:00

5 lines
198 B
Python

groups = open("input", "r").read().split("\n\n")
people = [[set(p) for p in g.split("\n") if p] for g in groups]
common = [set.intersection(*p) for p in people]
print(sum([len(c) for c in common]))