【leetcode刷题】59 spiral matrix II (python)

原题连接 https://leetcode.com/problems/spiral-matrix-ii 解题思路 用round记录当前处于第几轮,按照上右下左的顺序不断转圈输出便可。但须要注意的是当上下重合为一行时须要判断一下,停止程序。 代码web class Solution(object): def generateMatrix(self, n): """
相关文章
相关标签/搜索