voidsetZeroes(vector<vector<int>>& matrix){ int m = matrix.size(); int n = matrix[0].size(); bool *row, *col; row = newbool[m]; col = newbool[n]; for (int i = 0; i < m; i++) row[i] = 1; for (int i = 0;i < n; i++) col[i] = 1; for (int i = 0; i < m; i++) { for (int j = 0; j < n; j++) { if (!matrix[i][j]) { row[i] = 0; col[j] = 0; } } } for (int i = 0; i < m; i++) { for (int j = 0; j < n; j++) { if (!(row[i]&col[j])) { matrix[i][j] = 0; } } } }