Python解法
螺旋矩阵
http://www.nowcoder.com/questionTerminal/7edf70f2d29c4b599693dc3aaeea1d31
class Solution: def spiralOrder(self , matrix ): res = [] while matrix: res += matrix[0] matrix = list(zip(*matrix[1:]))[::-1] return res
螺旋矩阵
http://www.nowcoder.com/questionTerminal/7edf70f2d29c4b599693dc3aaeea1d31
class Solution: def spiralOrder(self , matrix ): res = [] while matrix: res += matrix[0] matrix = list(zip(*matrix[1:]))[::-1] return res
相关推荐