From 29e2b30ab066b36762326c3315e0e02702d3c246 Mon Sep 17 00:00:00 2001 From: Tomasz Kramkowski Date: Mon, 6 Dec 2021 08:25:51 +0000 Subject: day 4: shorter and cleaner --- 4.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/4.py b/4.py index 1b396cb..9dee99d 100644 --- a/4.py +++ b/4.py @@ -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 -- cgit v1.2.3-54-g00ecf