From 499f45e61349a7d2f6ddbd0c9b69ca79cd530d1c Mon Sep 17 00:00:00 2001 From: Tomasz Kramkowski Date: Sat, 4 Dec 2021 13:47:01 +0000 Subject: day 4: fix position calculation blunder --- 4.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/4.py b/4.py index eeb929e..0d44156 100644 --- a/4.py +++ b/4.py @@ -26,8 +26,8 @@ class Board: def call(self, num: int) -> None: if num not in self.nums: return pos: int = self.cells.index(num) - self.col_hits[pos // self.width] += 1 - self.row_hits[pos // self.height] += 1 + self.col_hits[pos % self.width] += 1 + self.row_hits[pos // self.width] += 1 self.unmarked_sum -= num self.has_bingo = ( any(hits == self.height for hits in self.col_hits) or -- cgit v1.2.3-54-g00ecf