diff options
author | Tomasz Kramkowski <tk@the-tk.com> | 2021-12-06 08:05:46 +0000 |
---|---|---|
committer | Tomasz Kramkowski <tk@the-tk.com> | 2021-12-06 08:05:46 +0000 |
commit | 7f4b9b1dd4da3d9ce04d068b5600e00e278939a6 (patch) | |
tree | 9bb9516149246b87987e2939093c7d6e49745ab5 | |
parent | 0689273df8a8220b2ef9d6cc67de9b005392c7ff (diff) | |
download | aoc2021-7f4b9b1dd4da3d9ce04d068b5600e00e278939a6.tar.gz aoc2021-7f4b9b1dd4da3d9ce04d068b5600e00e278939a6.tar.xz aoc2021-7f4b9b1dd4da3d9ce04d068b5600e00e278939a6.zip |
day 4: improved column iteration
-rw-r--r-- | 4.py | 5 |
1 files changed, 1 insertions, 4 deletions
@@ -26,10 +26,7 @@ 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(board[y][x] for y in range(len(board))) - for x in range(len(board[0])) - ) + col: int = min(max(col) for col in zip(*board)) win: Win = Win(i, min(row, col)) if win.round < first.round: first = win if win.round > last.round: last = win |