Clean 2022.

This commit is contained in:
Mikaël Capelle
2023-12-09 09:54:53 +01:00
parent 7c6c9e5995
commit 0ebd823656
25 changed files with 27 additions and 94 deletions

View File

@@ -1,5 +1,3 @@
# -*- encoding: utf-8 -*-
import copy
import sys
from functools import reduce
@@ -7,7 +5,6 @@ from typing import Callable, Final, Mapping, Sequence
class Monkey:
id: Final[int]
items: Final[Sequence[int]]
worry_fn: Final[Callable[[int], int]]
@@ -97,8 +94,7 @@ def run(
# number of inspects
inspects = {monkey: 0 for monkey in monkeys}
for round in range(n_rounds):
for _ in range(n_rounds):
for monkey in monkeys:
for item in items[monkey]:
inspects[monkey] += 1