kucheasysa

Algoverse_adesh_20

Jun 18th, 2024
413
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.38 KB | None | 0 0
  1. class Solution:
  2.     def rotate(self, matrix) :
  3.         """
  4.        Do not return anything, modify matrix in-place instead.
  5.        # """
  6.         for i in range(len(matrix)//2):
  7.             matrix[i] , matrix[-i-1] = matrix[-i-1], matrix[i]
  8.  
  9.         for i in range(len(matrix)):
  10.             for j in range(i):
  11.                 matrix[i][j] ,matrix[j][i] = matrix[j][i], matrix[i][j]
Advertisement
Add Comment
Please, Sign In to add comment