You are given a map of a city represented as a square nÃn grid. Each cell in the grid is either:
0 representing an empty plot of land, or 1 representing a building.
Your task is to find an empty plot of land such that the distance to the nearest building is maximized, and return this distance. If there are no buildings or no empty plots, return â1.
The distance between two locations (x1,y1) and (x2,y2) is calculated using the Manhattan distance formula: |x1-x2|+|y1-y2|
Your notes are automatically saved in your browser's local storage and will persist across sessions on this device.