From 9bb3b71da3c78fe28541b8d03515763b6f358c95 Mon Sep 17 00:00:00 2001 From: Ryan Reed Date: Mon, 6 Dec 2021 18:23:22 -0500 Subject: [PATCH] Correcting type hints and black reformatting --- puzzles/day06.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/puzzles/day06.py b/puzzles/day06.py index 9bbd08e..62eccef 100644 --- a/puzzles/day06.py +++ b/puzzles/day06.py @@ -18,22 +18,22 @@ class Reproduce: def __init__(self, times: List[int]) -> None: self.times = times - def start(self, days: int=80) -> None: + def start(self, days: int = 80) -> None: counts = Counter(self.times) for day in range(days): - next_counts = Counter() # Can't modify while iterating + next_counts = Counter() # Can't modify while iterating for count_key, count in counts.items(): if count_key == 0: - next_counts[6] += count # Move the parents back to 6 days - next_counts[8] += count # Add the new fish + next_counts[6] += count # Move the parents back to 6 days + next_counts[8] += count # Add the new fish else: - next_counts[count_key - 1] += count # Move count to next day count + next_counts[count_key - 1] += count # Move count to next day count counts = next_counts self.time_counts = counts - def count_fish(self): + def count_fish(self) -> int: return sum(self.time_counts.values())