# -*- coding:utf-8 -*-
class Solution:
# matrix类型为二维列表,需要返回列表
def printMatrix(self, matrix):
# write code here
ans = []#存储返回输出结果的列表
while matrix:#对矩阵进行逆时针截取操作
ans += matrix[0]
matrix = list(zip(*matrix[1:]))[::-1]
return ans



京公网安备 11010502036488号