Dev Ops in 30 Days

40. Combination Sum II - LeetCode

Similar to the solution of 39. Combination Sum I, this question can easily solved by backtracking. Simply decide whether choose this number or not would yield the answer. See solution:

Comments