Skip to content

#216 - Combination Sum III

MediumBacktracking
Open on LeetCode

Find all valid combinations of k numbers that sum up to n, where only digits 1 through 9 are used and each digit is used at most once. Return the list of all valid combinations.

InputOutput
k = 3, n = 7[[1,2,4]]
k = 3, n = 9[[1,2,6],[1,3,5],[2,3,4]]
k = 4, n = 1[]

Released under the MIT License.