Re: A common method to rotate the image

func rotate(_ matrix: inout [[Int]])

{

var s : Int = 0

var e : Int = matrix.count-1

```
while s<e
{
swap(&matrix[s], &matrix[e])
s = s + 1
e = e - 1
}
for i in stride(from: 0, to: matrix.count, by: 1)
{
for j in stride(from: i+1, to: matrix[i].count, by: 1)
{
swap(&matrix[j][i], &matrix[i][j])
}
}
}
```