You are given two integers m and n representing a 0-indexed grid of size m n. You are also given two 2D integer arrays, guards and walls, where guards[i] = [row_i, col_i] indicates the position of the walls[j] = [row_j, col_j] indicates the position of the
A guard can observe every cell along the four cardinal directions (north, south, east, and west) starting from their position, unless their line of sight is blocked by a wall or another guard. A cell is guarded if it can be seen by at least one guard.
Return the total number of unoccupied cells that are not guarded.
Note: A cell is occupied if it contains a guard or a wall. Occupied cells are not counted as guarded.
Constraints:
m, n
m n
guards.length, walls.length
guards.length walls.length m n
guards[i].length walls[j].length
m
n
All the positions in guards and walls are unique.
You are given two integers m and n representing a 0-indexed grid of size m n. You are also given two 2D integer arrays, guards and walls, where guards[i] = [row_i, col_i] indicates the position of the walls[j] = [row_j, col_j] indicates the position of the
A guard can observe every cell along the four cardinal directions (north, south, east, and west) starting from their position, unless their line of sight is blocked by a wall or another guard. A cell is guarded if it can be seen by at least one guard.
Return the total number of unoccupied cells that are not guarded.
Note: A cell is occupied if it contains a guard or a wall. Occupied cells are not counted as guarded.
Constraints:
m, n
m n
guards.length, walls.length
guards.length walls.length m n
guards[i].length walls[j].length
m
n
All the positions in guards and walls are unique.