Labyrinth
HardRating 1800CodeforcesShortest Paths & Topological Sort
Approach hintTry it first, then revealHide
For a fixed target cell, right moves minus left moves is a constant, so minimising left moves minimises right moves as well. Run a 0-1 BFS in which only left moves cost 1, then check both limits for each cell.