给定一个候选数字的集合 candidates
和一个目标值 target
. 找到 candidates
中所有的和为 target
的组合.
在同一个组合中, candidates
中的某个数字不限次数地出现.
样例 1:
输入: candidates = [2, 3, 6, 7], target = 7
输出: [[7], [2, 2, 3]]
样例 2:
输入: candidates = [1], target = 3
输出: [[1, 1, 1]]
target
) 都是正整数.原文:https://www.cnblogs.com/yunxintryyoubest/p/13418472.html