def rotate(matrix):
"""
Do not return anything, modify matrix in-place instead.
"""
n = len(matrix)
for y in range(n // 2): # 几层
for x in range(y, n-y-1): # 每条边的数据
m = n - 1
matrix[y][x], matrix[x][m-y], matrix[m-y][m-x], matrix[m-x][y] = matrix[m-x][y], matrix[y][x], matrix[x][m-y], matrix[m-y][m-x]