Data Parsing
The input is an \(R \times C\) grid with # for a wall, S for the start
tile, E for the end tile, and . for open spots.
Part One
The reindeer start at S facing East, and can move one tile at a time,
increasing their score by 1 point. They can also rotate clockwise or
counterclockwise 90 degrees at a time, increasing their score by 1000 points.
What is the lowest score a Reindeer could possibly get?
This is a
shortest paths problem
where Dijkstra’s algorithm is appropriate. The nodes are tiles on the grid. The
cost of an edge varies: if the next tile is in the same direction as we’re
currently heading, then the cost is 1, otherwise, the cost is 1000 + 1.
References
- Day 16 - Advent of Code 2024. Eric Wastl. adventofcode.com . Accessed Mar 9, 2026.