getpost expires 2027-11-07

Swim in Rising Water (LC5247)

Problem

Interview classic: Swim in Rising Water.

Approach

Binary search + DFS/BFS, or Dijkstra on grid max-edge.

Complexity

Time/space depend on constraints; aim for the optimal DP/graph solution above.

Practice tip

Walk through a small example out loud, state invariants, then code.

Practice with try it free.