Give a 2D array of 1’s and 0’s, where 1denotes a person and 0 denotes a empty cell, find the minimum number of persons needs to be evacuated such that we can stop the spread of covid and maintain social distancing. If two 1’s are adjacent to each other column-wise or row-wise remove one of them and diagonally adjacent 1’s need not to be removed
Example:
1 1 0
1 1 1
1 1 1
Output:
0 1 0
1 0 1
0 1 0