
LeetCode刷题
今天早下班
这个作者很懒,什么都没留下…
展开
-
长度最小的子数组
长度最小的子数组原创 2022-04-30 21:27:48 · 590 阅读 · 0 评论 -
螺旋矩阵 II
写一下思路先生成一个n*n的全零矩阵,主要判断在填充时候需要拐弯的边界条件:数组越界下一个填充的位置不为0设置一个标识target,当其为0,表示向右填充。顺时针方向依次表示不同方向。最后贴一下代码class Solution(object): def generateMatrix(self, n): """ :type n: int :rtype: List[List[int]] """ mat = [原创 2022-05-02 10:53:21 · 289 阅读 · 0 评论