This commit is contained in:
Tim Stallard 2020-12-06 11:51:37 +00:00
parent 8b6c82b0a2
commit cc000459ca
4 changed files with 2259 additions and 0 deletions

3
06/1.py Normal file
View File

@ -0,0 +1,3 @@
groups = open("input", "r").read().split("\n\n")
counts = [len(set(g.replace("\n", ""))) for g in groups]
print(sum(counts))

4
06/2.py Normal file
View File

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

2237
06/input Normal file

File diff suppressed because it is too large Load Diff

15
06/test Normal file
View File

@ -0,0 +1,15 @@
abc
a
b
c
ab
ac
a
a
a
a
b