Bomber Man
You are given a two-dimensional integer matrix
of 1
s and 0
s, where a 1
represents a bomb and 0
represents an empty cell. When a bomb explodes, all the spaces along on the same row and column are damaged. Return the number of spaces you can stand in to not get damaged.
Constraints
n * m ≤ 200,000
wheren
andm
are the number of rows and columns inmatrix
.
https://binarysearch.com/problems/Bomber-Man
Examples
Example 1
Input
- matrix =
[[1,0,0],
[0,1,0],
[0,0,0]]
Output
- answer =
1
Explanation
Only the bottom right cell is safe
Leave a comment