Merge pull request #1551 from Caesar-Wei/patch-3

Update 0031.下一个排列.md
This commit is contained in:
程序员Carl 2022-08-13 10:21:00 +08:00 committed by GitHub
commit 269a78f3a1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 7 additions and 7 deletions

View File

@ -195,7 +195,7 @@ class Solution:
break
self.reverse(nums, i, length-1)
break
else:
if n == 1:
# 若正常结束循环,则对原数组直接翻转
self.reverse(nums, 0, length-1)