diff --git a/day-15/day-15.py b/day-15/day-15.py index e103747..8a97582 100644 --- a/day-15/day-15.py +++ b/day-15/day-15.py @@ -11,7 +11,6 @@ def part_1(input): start = (0, 0) end = (x_size - 1, y_size - 1) cost = {start: 0} - prev = {start: None} queue = set([start]) done = set() neighbors = set([(-1, 0), (0, -1), (0, 1), (1, 0)]) @@ -32,7 +31,6 @@ def part_1(input): next_cost = cur_cost + nodes[n] if not n in cost or next_cost < cost[n]: cost[n] = next_cost - prev[n] = current queue.add(n) done.add(current) result = cost[end] @@ -58,7 +56,6 @@ def part_2(input): start = (0, 0) end = ((x_size * repeat) - 1, (y_size * repeat) - 1) cost = {start: 0} - prev = {start: None} queue = set([start]) done = set() neighbors = set([(-1, 0), (0, -1), (0, 1), (1, 0)]) @@ -81,7 +78,6 @@ def part_2(input): next_cost = cur_cost + nodes[n] if not n in cost or next_cost < cost[n]: cost[n] = next_cost - prev[n] = current queue.add(n) done.add(current) result = cost[end]