NeetCode #632LC-2812MediumAdvanced Graphs
← Back to All Problems

#632 · #2812 · Find the Safest Path in a Grid(找出最安全路径)

📌 Problem Statement & Constraints

You are given an n x n grid where 1 is a thief and 0 is empty. The safeness factor of a path is the minimum Manhattan distance from any cell on the path to the nearest thief. Return the maximum safeness factor over all paths from the top-left to the bottom-right. Constraints: 1 <= n <= 400.
🔒

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!