Skip to content

Commit 4a55090

Browse files
committed
refactor(Combination Sum)
1 parent 184d9ac commit 4a55090

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

go/combination_sum.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ func combinationSumBacktrackingIterative(candidates []int, target int) [][]int {
2828
current := stack[len(stack)-1]
2929
stack = stack[:len(stack)-1]
3030
if current.sum == target {
31-
combinations = append(combinations, append([]int{}, current.combination...))
31+
combinations = append(combinations, current.combination)
3232
continue
3333
}
3434
for i := current.index; i < len(candidates); i++ {

0 commit comments

Comments
 (0)