Created
August 20, 2021 03:25
-
-
Save goish135/bcc3578999ceaafd242a53bf87a9fdb0 to your computer and use it in GitHub Desktop.
#觀察題型 #簡單實作
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Solution: | |
def rotate(self, matrix: List[List[int]]) -> None: | |
""" | |
Do not return anything, modify matrix in-place instead. | |
""" | |
for i in range(len(matrix)): | |
for j in range(i+1,len(matrix)): | |
matrix[i][j],matrix[j][i] = matrix[j][i],matrix[i][j] | |
for k in range(len(matrix)): | |
matrix[k].reverse() | |
#print(matrix[k]) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment