Skip to content

Commit d7a71e1

Browse files
authored
Update 31-next-permutation.js
1 parent 4457d96 commit d7a71e1

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

31-next-permutation.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
*/
55
const nextPermutation = function(nums) {
66
const n = nums.length
7-
let k
7+
let k = null
88
for(let i = n - 2; i >= 0; i--) {
99
if(nums[i] < nums[i + 1]) {
1010
k = i

0 commit comments

Comments
 (0)