There was an error while loading. Please reload this page.
1 parent ff5f636 commit db930c6Copy full SHA for db930c6
Others/048.Rotate-Image/048.Rotate-Image_v2.py
@@ -0,0 +1,13 @@
1
+class Solution:
2
+ def rotate(self, matrix):
3
+ """
4
+ :type matrix: List[List[int]]
5
+ :rtype: void Do not return anything, modify matrix in-place instead.
6
7
+ N = len(matrix)
8
+ for i in range(N//2):
9
+ matrix[i],matrix[N-1-i] = matrix[N-1-i],matrix[i]
10
+ for i in range(N):
11
+ for j in range(0,i):
12
+ matrix[i][j],matrix[j][i] = matrix[j][i],matrix[i][j]
13
+
0 commit comments