Module aoc::year2015::day22

source ·
Expand description

§Wizard Simulator 20XX

Dijkstra’s algorithm is ideal for solving this problem. A node in the graph is our current state and each edge is represented by casting a spell to get to a new state.

The key to optimizing is to cache previously seen states. As we receive states in strictly increasing order of mana spent if we see a state again then it cannot possibly be optimal and we can discard.

Structs§

Functions§

Type Aliases§