Solve 6.1 and 6.2
This commit is contained in:
@@ -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))
|
||||
Reference in New Issue
Block a user