aoc2020/06/2.py

5 lines
198 B
Python
Raw Normal View History

2020-12-06 11:51:37 +00:00
groups = open("input", "r").read().split("\n\n")
people = [[set(p) for p in g.split("\n") if p] for g in groups]
2020-12-06 12:21:23 +00:00
common = [set.intersection(*p) for p in people]
2020-12-06 11:51:37 +00:00
print(sum([len(c) for c in common]))