diff --git a/LeetCode Problems/_73_SetMatrixZeros.java b/LeetCode Problems/_73_SetMatrixZeros.java new file mode 100644 index 00000000..82a7f509 --- /dev/null +++ b/LeetCode Problems/_73_SetMatrixZeros.java @@ -0,0 +1,52 @@ +package githubpr; + +import java.util.Arrays; + +/* +time n2 +space constant (changing in place) + */ +public class _73_SetMatrixZeros { + public void setZeroes(int[][] matrix) { + matrixZeros(matrix); + } + public void matrixZeros(int[][] arr){ + boolean firstCol=false,firstRow=false; + + //Step 1 : check for zeros and mark in the first row/col + for(int i=0;i