Free written solutionAs Far from Land as Possible (LeetCode 1162): Solution and Explanation
In a square grid of land and water, find the water cell whose nearest land is farthest away and return that distance.
Read the intuition, approach, code and complexity →