You are given an isWater representing a map composed of land and water cells:
If isWater[i][j] == 0, cell
If isWater[i][j] == 1, cell
You need to assign each cell a non-negative integer height such that:
The height of every water cell is
Any two adjacent cells sharing an edge (north, south, east, or west) have an absolute height difference of at most
Find a valid height assignment such that the maximum height across all cells in the matrix is maximized.
Return an height where height[i][j] is the assigned height of cell
Constraints:
m == isWater.length
n == isWater[i].length
isWater[i][j] is either
There is at least one water cell.
You are given an isWater representing a map composed of land and water cells:
If isWater[i][j] == 0, cell
If isWater[i][j] == 1, cell
You need to assign each cell a non-negative integer height such that:
The height of every water cell is
Any two adjacent cells sharing an edge (north, south, east, or west) have an absolute height difference of at most
Find a valid height assignment such that the maximum height across all cells in the matrix is maximized.
Return an height where height[i][j] is the assigned height of cell
Constraints:
m == isWater.length
n == isWater[i].length
isWater[i][j] is either
There is at least one water cell.