剑指 Offer 29. 顺时针打印矩阵 TODO

看的题解, 叹为观止

class Solution:
    def spiralOrder(self, matrix: List[List[int]]) -> List[int]:
        ret = []
        while matrix:
            ret += matrix.pop(0)
            matrix = list(zip(*matrix))[::-1]
        return ret
posted @ 2020-08-16 22:45  珊珊来迟0  阅读(56)  评论(0编辑  收藏  举报