Simple Solution in Python 3.8


#1

class Solution:
# @param A : list of list of integers
# @return the same list modified
def rotate(self, A):
#transpose the matrix
for i in range(len(A)):
for j in range(i+1,len(A)):
A[i][j], A[j][i] = A[j][i], A[i][j]
#reversing each element will result in column reverse
for i in range(len(A)):
A[i] = reversed(A[i])
return A