There was an error while loading. Please reload this page.
1 parent d2e46c5 commit 1ecdbadCopy full SHA for 1ecdbad
Day-06/python/paul2708/solution.py
@@ -1,5 +1,5 @@
1
from assertions import assert_equals
2
-from input_reader import read_lines, read_split_lines
+from input_reader import read_split_lines
3
from printer import aoc_print
4
5
groups = read_split_lines("day06")
@@ -18,3 +18,17 @@
18
assert_equals(6714, total_sum)
19
20
# Part two
21
+total_sum = 0
22
+for group in groups:
23
+ votes = list()
24
+
25
+ for single_person in group:
26
+ for question in single_person:
27
+ votes.append(question)
28
29
+ for vote in set(votes):
30
+ if votes.count(vote) == len(group):
31
+ total_sum += 1
32
33
+aoc_print(f"The count of 'yes' votes in every group is {total_sum}.")
34
+assert_equals(3435, total_sum)
0 commit comments