Search
⌘K

Leetcode 1765. Map of Highest Peak

Assign nonnegative heights to a grid so water cells are 0, adjacent cells differ by at most 1, and the global maximum height is maximized. This reduces to computing each cell's distance to the nearest water cell (a multi-source BFS/shortest-path on the unweighted grid).


Question Timeline

See when this question was last asked and where, including any notes left by other candidates.

Comments

Your account is free and you can post anonymously if you choose.