From bffb90e7f2e91d4e4f684719436865ac4f4da09d Mon Sep 17 00:00:00 2001 From: Nathan van Ofwegen Date: Thu, 10 Dec 2020 22:27:27 +0100 Subject: [PATCH] Ho, dubbele cast --- day9/day9.py | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/day9/day9.py b/day9/day9.py index 60a94f1..a0e1141 100644 --- a/day9/day9.py +++ b/day9/day9.py @@ -38,11 +38,8 @@ def part2(): for size in range(2, len(lines)): for finger in range(0, len(lines) - size): subset = lines[finger:(finger + size)] - subset = [int(i) for i in subset] - if sum(subset) == number: - ans = min(subset) + max(subset) - print("Part 2: %d" % ans) + print("Part 2: %d" % (min(subset) + max(subset))) return