看的题解, 叹为观止
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
看的题解, 叹为观止
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