The following code is simple, but I get a runtime error called "Last executed input: [[1]]

"

Who can figure this out? thanks.

```
void rotate(vector<vector<int>>& matrix) {
int n = matrix.size();
vector<vector<int>> newv;
copy(matrix.begin(), matrix.end(), newv.begin());
for (int i = 0; i < n; i++)
{
for (int j = 0; j < n; j++)
{
matrix[i,j] = newv[n - j - 1, i];
}
}
}
```