Skip to content

Commit 8161034

Browse files
Solve : Rotate Image
1 parent 9e4c675 commit 8161034

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

rotate-image/printjin-gmailcom.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
class Solution:
2+
def rotate(self, matrix):
3+
n = len(matrix)
4+
for i in range(n):
5+
for j in range(i + 1, n):
6+
matrix[i][j], matrix[j][i] = matrix[j][i], matrix[i][j]
7+
for row in matrix:
8+
row.reverse()

0 commit comments

Comments
 (0)