#39 - Combination Sum
Given an array of distinct integers candidates and a target, return all unique combinations where the chosen numbers sum to target. The same number may be chosen an unlimited number of times. Combinations are returned in any order.
| Input | Output |
|---|---|
candidates = [2,3,6,7], target = 7 | [[2,2,3],[7]] |
candidates = [2,3,5], target = 8 | [[2,2,2,2],[2,3,3],[3,5]] |