summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTomasz Kramkowski <tk@the-tk.com>2021-12-06 08:05:46 +0000
committerTomasz Kramkowski <tk@the-tk.com>2021-12-06 08:05:46 +0000
commit7f4b9b1dd4da3d9ce04d068b5600e00e278939a6 (patch)
tree9bb9516149246b87987e2939093c7d6e49745ab5
parent0689273df8a8220b2ef9d6cc67de9b005392c7ff (diff)
downloadaoc2021-7f4b9b1dd4da3d9ce04d068b5600e00e278939a6.tar.gz
aoc2021-7f4b9b1dd4da3d9ce04d068b5600e00e278939a6.tar.xz
aoc2021-7f4b9b1dd4da3d9ce04d068b5600e00e278939a6.zip
day 4: improved column iteration
-rw-r--r--4.py5
1 files changed, 1 insertions, 4 deletions
diff --git a/4.py b/4.py
index 4ee51be..1b396cb 100644
--- a/4.py
+++ b/4.py
@@ -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