Combination Sum III
Find all possible combinations of k numbers that add up to a number n, given that only numbers from 1 to 9 can be used and each combination should be a unique set of numbers.
Note:
All numbers will be positive integers.
The solution set must not contain duplicate combinations.
Example 1:
Example 2:
Solution
Basically the same idea as Combination I, II. The difference is that the given candidates is now 1, 2, ..., 9 for each position in the combination, and the constraints is the number of numbers in the combination. So there's similarities with Combinations too.
Reference
Last updated