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: