Available question text
Given an n×n grid of 0s (water) and 1s (land), find the water cell whose Manhattan distance to the nearest land cell is maximal and return that distance (return -1 if there is no land or no water). This is typically solved by computing nearest-land distances via a multi-source BFS from all land cells.
Related questions
Continue with questions that share topics or the same question type.
- Find All Possible Recipes from Given Supplies
Coding · Array · Directed Acyclic Graph · Graph Theory
- Remove Substrings from a Larger String and Determine If Multiple Final Results Are Possible
Coding
- Sort a list of input letters where there is only a subset of possible letters from the alphabet (as in 3-4 different letters, but many instances).
Coding
- Accepted Candidates From the Interviews
Coding
Sources · 1 reference
These records explain where the question appears. A company tag or candidate report does not guarantee a future interview question.
Hello Interview · 1 record
No company association
Leetcode 1162. As Far from Land as Possible
Reported date not specified · 0 source reports
Source snapshot: Nov 12, 2026
View source