From c3dd5676b745928eecb1169700218123d2b25af1 Mon Sep 17 00:00:00 2001 From: Ryan Reed Date: Sat, 4 Dec 2021 20:03:26 -0500 Subject: [PATCH] End a bit earlier for efficiency --- puzzles/day04.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/puzzles/day04.py b/puzzles/day04.py index 2bf4571..761a2d6 100644 --- a/puzzles/day04.py +++ b/puzzles/day04.py @@ -39,6 +39,9 @@ class Bingo: if self._is_solved(board): winning_scores.append(self._calculate_score(board, draw)) + if not squid_rules: + return winning_scores[0] + try: game = np.delete(game, index, axis=0) except IndexError: # I don't understand why this is needed