40.Combination Sum II
https://leetcode.com/problems/combination-sum-ii/
1.Description(Medium)
Given a collection of candidate numbers (C) and a target number (T), find all unique combinations in C where the candidate numbers sums to T.
Each number in_C_may only be used once in the combination.
Notice
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.
Example
Given candidate set[10,1,6,7,2,1,5]
and target8
,
A solution set is:
2.Code
Last updated
Was this helpful?