Skip to content

Commit f9d3a8c

Browse files
committed
refactor(Combination Sum)
1 parent f265286 commit f9d3a8c

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)