Combination Sum II
MediumAcceptance Rate 53.2%
Given a collection of candidate numbers
candidates and a target number target, find all unique combinations in candidates where the candidate numbers sum to target.Examples
Example 1
Input
candidates = [10,1,2,7,6,1,5], target = 8
Output
[[1,1,6],[1,2,5],[1,7],[2,6]]
Constraints
1 <= candidates.length <= 1001 <= candidates[i] <= 501 <= target <= 30