Worked solutions
Follow each problem from its first example to a working algorithm.
-
Sliding Puzzle
For a 2-by-3 board with tiles 0 through 5, return the fewest adjacent blank swaps needed to reach [[1,2,3],[4,5,0]], or -1 if unreachable.
-
Swim in Rising Water
Find the earliest water level at which a path exists from the top-left to the bottom-right of an elevation grid.