NeetCode #638LC-2577HardAdvanced Graphs
← Back to All Problems

#638 · #2577 · Minimum Time to Visit a Cell In a Grid(在网格图中访问一个格子的最少时间)

📌 Problem Statement & Constraints

You are given an m x n grid where grid[i][j] is the earliest time you may enter cell (i, j). You start at (0, 0) at time 0 and each move takes 1 second. You may not wait, but you may move back and forth. Return the minimum time to reach the bottom-right, or -1. Constraints: 2 <= m, n <= 1000, 0 <= grid[i][j] <= 10^5.
🔒

Sign In to Unlock Full Solutions for All 973 Problems

Sign in to access step-by-step logic, benchmark Python3 code, complexity breakdown, and offline export!