Solve 6.1 and 6.2

This commit is contained in:
2021-05-03 20:04:55 +03:00
parent 22e2aeef74
commit 38ce3743fd
2 changed files with 2091 additions and 0 deletions
+7
View File
@@ -0,0 +1,7 @@
with open("input") as f:
groups = [[x for x in group.split("\n")] for group in f.read().strip().split("\n\n")]
print(sum(len(set().union(*(set(person) for person in group))) for group in groups))
from functools import reduce
print(sum(len(reduce(set.intersection, (set(person) for person in group))) for group in groups))
+2084
View File
File diff suppressed because it is too large Load Diff