Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit 6877683

Browse files
Merge pull request youngyangyang04#1217 from mxdneu/master
fix js螺旋数组
2 parents 4723ecc + 1496b59 commit 6877683

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

‎problems/0059.螺旋矩阵II.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -246,11 +246,11 @@ var generateMatrix = function(n) {
246246
res[row][col] = count++;
247247
}
248248
// 下行从右到左(左闭右开)
249-
for (; col > startX; col--) {
249+
for (; col > startY; col--) {
250250
res[row][col] = count++;
251251
}
252252
// 左列做下到上(左闭右开)
253-
for (; row > startY; row--) {
253+
for (; row > startX; row--) {
254254
res[row][col] = count++;
255255
}
256256

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /