Skip to content

Commit

Permalink
[2024/11] remove num_stones()
Browse files Browse the repository at this point in the history
  • Loading branch information
StarlitGhost committed Dec 11, 2024
1 parent e640aa0 commit 31bb945
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions 2024/11/script.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,20 +43,16 @@ def blink_n_times(stones: dict[int, int], n: int) -> dict[int, int]:
return stones


def num_stones(stones: dict[int, int]) -> int:
return sum(stones.values())


def main():
start_stones = Counter([int(stone) for stone in aoc.read().split()])
if aoc.args.verbose:
print(start_stones)

stones = blink_n_times(start_stones, 25)
print(f"p1: {num_stones(stones)}")
print(f"p1: {sum(stones.values())}")

stones = blink_n_times(start_stones, 75)
print(f"p2: {num_stones(stones)}")
print(f"p2: {sum(stones.values())}")


if __name__ == "__main__":
Expand Down

0 comments on commit 31bb945

Please sign in to comment.