static void markLines(int[][] m) {
        boolean[] column = new boolean[m.length];
        boolean[] row = new boolean[m[0].length];

        for (int i = 0; i < m.length; i++) {
            for (int j = 0; j < m[0].length; j++) {
                if (m[i][j] == 0) {
                    column[i] = true;
                    row[j] = true;
                }
            }
        }

        for (int i = 0; i < column.length; i++) {
            for (int j = 0; j < row.length; j++) {
                if (column[i] || row[j]) {
                    m[i][j] = 0;
                }
            }
        }
    }