classSolution: defrotate(self, matrix: List[List[int]]) -> None: """ Do not return anything, modify matrix in-place instead. """ n = len(matrix) for i inrange(n): for j inrange(i+1, n): matrix[i][j], matrix[j][i] = matrix[j][i], matrix[i][j] for i inrange(n): for j inrange(n//2): matrix[i][j], matrix[i][n-j-1] = matrix[i][n-j-1], matrix[i][j]