Skip to content

Latest commit

 

History

History
31 lines (27 loc) · 671 Bytes

39-Combination-Sum.md

File metadata and controls

31 lines (27 loc) · 671 Bytes

Combination Sum

给定一个 (无重复的) 候选数字 (候选者) 集合和一个目标数字 (目标值), 在候选着中找到所有唯一的组合, 其候选数字的和等于目标值
可能从候选者中华选出相同重复的数字, 并且不限制次数

注意

  • 所有数字 (包括目标值) 都是正整数
  • 解答集不能包含重复的组合

示例 1:

输入: candidates = [2,3,6,7], target = 7,
解答集是:
[
  [7],
  [2,2,3]
]

示例 2:

输入: candidates = [2,3,5], target = 8,
解答集是:
[
  [2,2,2,2],
  [2,3,3],
  [3,5]
]

参考: Combination Sum