From 7f4b9b1dd4da3d9ce04d068b5600e00e278939a6 Mon Sep 17 00:00:00 2001 From: Tomasz Kramkowski Date: Mon, 6 Dec 2021 08:05:46 +0000 Subject: day 4: improved column iteration --- 4.py | 5 +---- 1 file changed, 1 insertion(+), 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 -- cgit v1.2.3-54-g00ecf