```
class Solution {
public:
void setZeroes(vector<vector<int> > &matrix) {
int m = matrix.size();
int n = matrix[0].size();
int *row = new int[m];
int *col = new int[n];
int i,j;
for (i= 0;i<=m;i++)
{
for (j=0;j<=n;j++)
if (matrix[i][j] == 0)
{
row[i] = 2;
col[j] = 2;
}
}
for (i= 0;i<=m;i++)
{
for (j=0;j<=n;j++)
if ((row[i] == 2)||(col[j] == 2))
matrix[i][j] = 0;
}
}
};
```