01 · Question
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.
Each number in candidates may only be used once in the combination.
Note: The solution set must not contain duplicate combinations.
Candidates and target are positive integers.
02 · Analysis
Sort positive candidates, choose indices in increasing order, and recurse at i+1 so each occurrence is used once. Skip equal values only at the same decision depth; deeper levels may still use another equal occurrence. Stop scanning when a candidate exceeds the remaining positive target. Worst-case enumeration including copies is O(n*2^n), plus O(n log n) sorting; auxiliary path/stack space is O(n), excluding output.