Swim in Rising Water
An n x n grid holds a permutation of 0..n^2-1 as elevations. At time t you can swim into any cell with elevation <= t, moving 4-directionally with no cost. Print the least time needed to reach the bottom-right cell from the top-left one.
Constraints
1 <= n <= 50
Discussion
No discussions yet.
Shalyam Support
Hi! Ask us anything — we'll reply on WhatsApp or Telegram within 24 hours.