```
n = int(len(arr))
for i in range(n//2):
for j in range(i, n-i-1):
t = arr[i][j]
arr[i][j] = arr[n-j-1][i]
arr[n-j-1][i] = arr[n-i-1][n-j-1]
arr[n-i-1][n-j-1] = arr[j][n-i-1]
arr[j][n-i-1] = t
```