Finish day 6 part 2

This commit is contained in:
Ethanell 2020-12-06 12:23:01 +01:00
parent 25d13b481c
commit bccd6d0cb6
2 changed files with 2178 additions and 0 deletions

View file

@ -0,0 +1,13 @@
qs = []
with open("input.txt") as f:
for q in f.read().split("\n\n"):
s = {}
q = list(filter(lambda x: x, q.split("\n")))
ln = len(q)
for a in q:
for le in list(a):
s[le] = s[le] + 1 if le in s else 1
qs.append(list(filter(lambda x: s[x] == ln, s)))
print(sum(map(lambda x: len(x), qs)))

2165
2020/day 6/P2/input.txt Normal file

File diff suppressed because it is too large Load diff