Swim in Rising Water
Cross a grid while the water rises, so a path costs its tallest cell. Why a priority queue that always steps onto the lowest reachable cell finds the earliest moment you can swim across, and how Union-Find gets there another way.
Spotted a mistake in this lesson?Report an issue →