Browse Source

Cleaning up silly logic

pull/4/head
Ryan Reed 3 years ago
parent
commit
f00e66bfd7
1 changed files with 2 additions and 5 deletions
  1. +2
    -5
      puzzles/day04.py

+ 2
- 5
puzzles/day04.py View File

@ -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:


Loading…
Cancel
Save