@@ -0,0 +1,810 @@
+/**%0A * Find all possible combinations of k numbers that add up to a number n,%0A * given that only numbers from 1 to 9 can be used and each combination %0A * should be a unique set of numbers.%0A */%0Apublic class Solution %7B%0A  public List%3CList%3CInteger%3E%3E combinationSum3(int k, int n) %7B%0A    List%3CList%3CInteger%3E%3E list = new ArrayList%3CList%3CInteger%3E%3E();%0A    helper(k, n, 1, list, new ArrayList%3CInteger%3E());%0A    return list;%0A  %7D%0A  %0A  void helper(int k, int n, int i, List%3CList%3CInteger%3E%3E list, List%3CInteger%3E cur) %7B%0A    if (n == 0 && cur.size() == k) %7B%0A      list.add(new ArrayList%3CInteger%3E(cur));%0A      return;%0A    %7D else if (n %3C 0) %7B%0A      return;%0A    %7D%0A    %0A    for (int index = i; index %3C 10; index ++) %7B%0A      cur.add(index);%0A      helper(k, n - index, index + 1, list, cur);%0A      cur.remove(cur.size() - 1);%0A    %7D%0A  %7D%0A%7D

Add combination sum iii