Skip to content

Commit

Permalink
Update 0054.螺旋矩阵.md
Browse files Browse the repository at this point in the history
  • Loading branch information
youngyangyang04 authored Jan 4, 2022
1 parent 24adf56 commit 1e169a0
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions problems/0054.螺旋矩阵.md
Original file line number Diff line number Diff line change
Expand Up @@ -111,15 +111,12 @@ public:
// 如果min(rows, columns)为奇数的话,需要单独给矩阵最中间的位置赋值
if (min(rows, columns) % 2) {
if(rows > columns){
for (int i = mid; i < mid + rows - columns + 1; ++i)
{
for (int i = mid; i < mid + rows - columns + 1; ++i) {
res[count++] = matrix[i][mid];
}

}
else{
for (int i = mid; i < mid + columns - rows + 1; ++i)
{
} else {
for (int i = mid; i < mid + columns - rows + 1; ++i) {
res[count++] = matrix[mid][i];
}
}
Expand Down

0 comments on commit 1e169a0

Please sign in to comment.