Deep Dive

Swim in Rising Water

778. Swim in Rising Water · Shortest paths · 70 of 78

1/8

Swim when the water rises

0027618345
In this lessonStep 1 of 8 · ← → keys
The question

A grid of heights fills with water, one level per second. Find the earliest time you can swim from the top-left to the bottom-right. It is Dijkstra, but a path's cost is its highest square.