#778

Swim in Rising Water

hard· Advanced Graphsruns: 0

You are given an n x n integer matrix grid where each value represents the elevation at that point. At time t, the water level is t everywhere. You can swim from a square to another 4-directionally adjacent square only if the elevation of both squares is at most t. Starting from the top-left square (0, 0), return the minimum time until you can reach the bottom-right square (n - 1, n - 1).

sign in to paste and practice your own solution
desktop only

codedrill is a typing game and needs a real keyboard. open this on a laptop or desktop to practice.

you can still browse problems and sections from your phone.