diff options
author | Tomasz Kramkowski <tk@the-tk.com> | 2021-12-06 08:25:51 +0000 |
---|---|---|
committer | Tomasz Kramkowski <tk@the-tk.com> | 2021-12-06 08:49:58 +0000 |
commit | 29e2b30ab066b36762326c3315e0e02702d3c246 (patch) | |
tree | 573c1ef5b554c06a4fb1b85441e6923bd6ae4ada | |
parent | 36bd3e75b10a4cfa333815170044f54c41487ab5 (diff) | |
download | aoc2021-29e2b30ab066b36762326c3315e0e02702d3c246.tar.gz aoc2021-29e2b30ab066b36762326c3315e0e02702d3c246.tar.xz aoc2021-29e2b30ab066b36762326c3315e0e02702d3c246.zip |
day 4: shorter and cleaner
-rw-r--r-- | 4.py | 7 |
1 files changed, 4 insertions, 3 deletions
@@ -25,9 +25,10 @@ boards = [board_from_string(board) for board in boards] first: Win = Win(None, max(nums)) last: Win = Win(None, 0) for i, board in enumerate(boards): - row: int = min(max(row) for row in board) - col: int = min(max(col) for col in zip(*board)) - win: Win = Win(i, min(row, col)) + win: Win = Win(i, min( + min(max(row) for row in board), + min(max(col) for col in zip(*board)) + )) if win.round < first.round: first = win if win.round > last.round: last = win |