From f00e66bfd7852d4eb296e9b22a7f5ca8c275e731 Mon Sep 17 00:00:00 2001 From: Ryan Reed Date: Sat, 4 Dec 2021 12:29:57 -0500 Subject: [PATCH] Cleaning up silly logic --- puzzles/day04.py | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/puzzles/day04.py b/puzzles/day04.py index fd49a80..a65890d 100644 --- a/puzzles/day04.py +++ b/puzzles/day04.py @@ -43,7 +43,7 @@ class Bingo: self.winning_score = self.calculate_score(board, draw) return self.winning_score - return 0 + return self.winning_score def _draw(self) -> int: for draw in self.draws: @@ -59,10 +59,7 @@ class Bingo: # Solved if any row or column is 0 cols = np.nansum(board, axis=0) rows = np.nansum(board, axis=1) - if np.count_nonzero(cols) != cols.size or np.count_nonzero(rows) != rows.size: - return True - - return False + return (np.count_nonzero(cols) != cols.size or np.count_nonzero(rows) != rows.size) def part1(inputs: str) -> int: