Skip to content

Instantly share code, notes, and snippets.

@goish135
Created August 20, 2021 03:25
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save goish135/bcc3578999ceaafd242a53bf87a9fdb0 to your computer and use it in GitHub Desktop.
Save goish135/bcc3578999ceaafd242a53bf87a9fdb0 to your computer and use it in GitHub Desktop.
#觀察題型 #簡單實作
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