You are given an m n binary matrix grid, where
A move consists of walking from one land cell to another horizontally or vertically adjacent land cell, or walking off the boundary of the grid.
Return the number of land cells in grid from which it is impossible to walk off the boundary of the grid in any number of moves.
Constraints:
m == grid.length
n == grid[i].length
m, n
grid[i][j] is either
You are given an m n binary matrix grid, where
A move consists of walking from one land cell to another horizontally or vertically adjacent land cell, or walking off the boundary of the grid.
Return the number of land cells in grid from which it is impossible to walk off the boundary of the grid in any number of moves.
Constraints:
m == grid.length
n == grid[i].length
m, n
grid[i][j] is either