aoc2023/day-17/two.go
2023-12-23 11:58:21 +00:00

15 lines
382 B
Go

package main
// two returns the lowest cost path for a given graph from start to end coords
// 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
}