Skip to content

Commit f4f6ff8

Browse files
committed
refactor next permutation
1 parent 9f22efe commit f4f6ff8

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

go/next_permutation.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ package main
1010
// nums[isSortedUntil] >= nums[isSortedUntil+1]は>ではなく、>=でないと
1111
// [1, 1]などではOut of indexになる
1212
func nextPermutation(nums []int) {
13-
if len(nums) <= 1 {
13+
if len(nums) == 0 {
1414
return
1515
}
1616
isSortedUntil := len(nums) - 2

0 commit comments

Comments
 (0)