Add code for 2020 day 6.
This commit is contained in:
parent
54601c8efa
commit
90d1031207
3 changed files with 36 additions and 0 deletions
16
day_6/part_1.py
Normal file
16
day_6/part_1.py
Normal file
|
|
@ -0,0 +1,16 @@
|
|||
with open("data") as f:
|
||||
plane = f.read()
|
||||
|
||||
|
||||
plane = plane.split("\n\n")
|
||||
|
||||
count = 0
|
||||
for group in plane:
|
||||
group_answers = []
|
||||
for person in group.split("\n"):
|
||||
for q in person:
|
||||
if q not in group_answers:
|
||||
group_answers.append(q)
|
||||
count += len(group_answers)
|
||||
|
||||
print(count)
|
||||
Loading…
Add table
Add a link
Reference in a new issue