Browse Source

Cleanup

pull/6/head
Ryan Reed 3 years ago
parent
commit
90ef6af6e2
1 changed files with 2 additions and 2 deletions
  1. +2
    -2
      puzzles/day06.py

+ 2
- 2
puzzles/day06.py View File

@ -20,13 +20,13 @@ class Reproduce:
def start(self, days: int = 80) -> None:
counts = Counter(self.times)
for day in range(days):
for _ in range(days):
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
else:
next_counts[count_key - 1] += count # Move count to next day count


Loading…
Cancel
Save