Skip to content

Commit f9004a2

Browse files
committed
feat: add solutions to lc problem: No.0040
No.0040.Combination Sum II
1 parent aeb97c1 commit f9004a2

File tree

11 files changed

+685
-205
lines changed

11 files changed

+685
-205
lines changed

solution/0000-0099/0039.Combination Sum/README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@
5454

5555
**方法一:排序 + 剪枝 + 回溯(两种写法)**
5656

57-
我们先对数组 $candidates$ 排序,这样当我们搜索到某个下标 $i$ 时,如果 $candidates[i]$ 大于剩余目标值 $target$,则后面的元素都不用搜索了,因为它们都比 $target$ 大
57+
我们可以先对数组进行排序,方便剪枝
5858

5959
接下来,我们设计一个函数 $dfs(i, s)$,表示从下标 $i$ 开始搜索,且剩余目标值为 $s$,其中 $i$ 和 $s$ 都是非负整数,当前搜索路径为 $t$,答案为 $ans$。
6060

0 commit comments

Comments
 (0)