Given a set of candidate numbers (C) and a target number (T ), find all unique combinations in C where
the candidate numbers sums to T .
The same repeated number may be chosen from C once number of times.
Note:
• All numbers (including target) will be positive integers.
• Elements in a combination (a1, a2, …, ak) must be in non-descending order. (ie, a1 > a2 > … > ak).
• The solution set must not contain duplicate combinations.
For example, given candidate set 10,1,2,7,6,1,5 and target 8, A solution set is:
[1, 7]
[1, 2, 5]
[2, 6]
[1, 1, 6]
Combination Sum II
最新推荐文章于 2025-05-25 18:32:47 发布
本文探讨了一类经典的组合求和问题:给定一组候选数和一个目标数,寻找所有可能的组合,使得组合中候选数之和等于目标数。允许同一候选数重复使用多次,但要求组合中的数按非递减顺序排列且不包含重复组合。
363

被折叠的 条评论
为什么被折叠?



