From 4a3e9c6bbea4acbb73c6decd2693ba0aec164a33 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=B5=B5=E4=BA=9A=E6=9D=B0?= <105789281+zyj1112@users.noreply.github.com> Date: Thu, 12 Oct 2023 11:11:25 +0800 Subject: [PATCH] =?UTF-8?q?Update=200054.=E8=9E=BA=E6=97=8B=E7=9F=A9?= =?UTF-8?q?=E9=98=B5.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- problems/0054.螺旋矩阵.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/problems/0054.螺旋矩阵.md b/problems/0054.螺旋矩阵.md index 59771a67..44a7749d 100644 --- a/problems/0054.螺旋矩阵.md +++ b/problems/0054.螺旋矩阵.md @@ -260,7 +260,7 @@ class Solution(object): :type matrix: List[List[int]] :rtype: List[int] """ - if len(matrix)==0 or len(matrix[0])==0 : # 判定List是否为空 + if len(matrix) == 0 or len(matrix[0]) == 0 : # 判定List是否为空 return [] row, col = len(matrix), len(matrix[0]) # 行数,列数 loop = min(row, col) // 2 # 循环轮数 @@ -268,7 +268,7 @@ class Solution(object): i, j =0, 0 count = 0 # 计数 offset = 1 # 每轮减少的格子数 - result = [0]*(row*col) + result = [0] * (row * col) while loop>0 :# 左闭右开 i, j = stx, sty while j < col - offset : # 从左到右