diff options
-rw-r--r-- | 4.py | 4 |
1 files changed, 1 insertions, 3 deletions
@@ -34,17 +34,15 @@ class Board: return Board([[int(n) for n in l.split()] for l in s.split('\n')]) def solve(nums: list[int], boards: list[Board]) -> tuple[int, int]: - won: set[int] = set() wins: list[int] = [] num: int for num in nums: i: int board: Board for i, board in enumerate(boards): - if i in won: continue + if board.has_bingo: continue board.call(num) if board.has_bingo: - won.add(i) wins.append(num * board.unmarked_sum) return wins[0], wins[-1] |