Given an n x n grid where each cell holds an elevation, at time t you may swim between adjacent cells only if both cells' elevations are at most t. Starting at the top-left and ending at the bottom-right, return the minimum time at which a path exists.
grid = [[0,2],[1,3]]3Solve it in the editor. Sign in free to run your Python or JavaScript against test cases, get a verdict, and track your attempts.
Solve on FeatCode →Beyond basic traversal, some graph problems need ordering constraints (topological sort) or weighted shortest paths (Dijkstra, Bellman-Ford, minimum spanning trees).
Read the full Advanced Graphs guide →
Original problem on LeetCode ↗