From 082a65b36ba3bd0336c7618ead50f1889e19cef6 Mon Sep 17 00:00:00 2001 From: Stefan Harmuth Date: Tue, 13 Dec 2022 07:56:40 +0100 Subject: [PATCH] day13 - remember the f'ing zip()! It's not *that* hard ... --- day13.py | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/day13.py b/day13.py index 5ebdce4..6429c84 100644 --- a/day13.py +++ b/day13.py @@ -6,10 +6,7 @@ from typing import Any def packet_compare(left: list, right: list, debug: int = 0) -> int: - for i in range(min(len(left), len(right))): - l_value = left[i] - r_value = right[i] - + for l_value, r_value in zip(left, right): if isinstance(l_value, list) and isinstance(r_value, int): r_value = [r_value] elif isinstance(l_value, int) and isinstance(r_value, list):