Update 0031.下一个排列.md

This commit is contained in:
coolcty 2022-01-21 17:52:43 +01:00 committed by GitHub
parent 7b557f2ca9
commit 61b0ddef35
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 1 deletions

View File

@ -81,7 +81,7 @@ public:
for (int j = nums.size() - 1; j > i; j--) {
if (nums[j] > nums[i]) {
swap(nums[j], nums[i]);
sort(nums.begin() + i + 1, nums.end());
reverse(nums.begin() + i + 1, nums.end());
return;
}
}