aoc2023/day-17/two.go
2023-12-22 21:56:07 +00:00

15 lines
357 B
Go

package main
// two returns the lowest cost path from start to end
// with a min/max distance set
func two(lines []string) int {
graph := buildGraph(lines)
start := newCoords(0, 0)
end := newCoords(len(graph[0])-1, len(graph)-1)
dijkstra := newDijkstra(graph, WithMinDistance(4), WithMaxDistance(10))
cost := dijkstra.run(start, end)
return cost
}