From 5d42709ea4083ae330ce15bd63d933000711094a Mon Sep 17 00:00:00 2001 From: Ryan Reed Date: Thu, 9 Dec 2021 19:13:21 -0500 Subject: [PATCH] Using coords instead of value in lowest point determination --- puzzles/day09.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/puzzles/day09.py b/puzzles/day09.py index 9e33588..c10ba36 100644 --- a/puzzles/day09.py +++ b/puzzles/day09.py @@ -31,13 +31,13 @@ class Heightmap: elif y != max_y and self.heightmap[y+1][x] <= value: continue - self.low_point_values.append(value) + self.low_point_values.append((x,y)) def calculate_risk_score(self): if self.low_point_values is None: self.find_low_points() - return sum(value+1 for value in self.low_point_values) + return sum(self.heightmap[coords[1]][coords[0]]+1 for coords in self.low_point_values) def part1(inputs: List[int]) -> int: