From 8e208459d29eeca8bc64739ce43a85d5e31af8fa Mon Sep 17 00:00:00 2001 From: Ryan Reed Date: Fri, 3 Dec 2021 17:12:54 -0500 Subject: [PATCH] Adding docstring for commonality --- puzzles/day03.py | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/puzzles/day03.py b/puzzles/day03.py index d1598de..832277a 100644 --- a/puzzles/day03.py +++ b/puzzles/day03.py @@ -88,7 +88,20 @@ class Diagnostics: return oxygen_generator_rating * co2_scrubber_rating @staticmethod - def commonality(report: List[int]) -> List[Dict[str, int]]: + def commonality(report: List[int]) -> List[int]: + """ + Return the most common value in each column of binary numbers + + Args: + report: List of binary numbers + + Returns: + List containing the most common value in the column + Possible Values: + 0 + 1 + 2 - This indicates equally common + """ num_1 = defaultdict(int) for binary in report: for column, bit in enumerate(binary):