code for puzzle to set row and column of a matrix to zero

code for an algorithm such that if an element in an MxN matrix is 0, its
entire row and column is set to 0.