diff --git a/rotate-img.py b/rotate-img.py new file mode 100644 index 0000000..54d90dc --- /dev/null +++ b/rotate-img.py @@ -0,0 +1,9 @@ +class Solution: + def rotate(self, matrix: List[List[int]]) -> None: + """ + Do not return anything, modify matrix in-place instead. + """ + x = [[matrix[-(j+1)][i] for j in range(len(row))] for i,row in enumerate(matrix)] + for i,m in enumerate(x): + for j,n in enumerate(m): + matrix[i][j] = n