Combination Sum III
Find all valid combinations of k numbers that sum up to n such that: Only numbers 1 through 9 are used, each number is used at most once. Return a list of all possible valid combinations.

30:00

Combination Sum III
medium
Topics
Companies

Find all valid combinations of k numbers that sum up to n such that: Only numbers 1 through 9 are used, each number is used at most once. Return a list of all possible valid combinations.

Example 1:
Input: {"k":3,"n":7}
Output: [[1,2,4]]
Constraints:
  • 2k92 \leq k \leq 9

  • 1n601 \leq n \leq 60

Input
arr ={"k":3,"n":7}
Available Numbers (1-9)

1

2

3

4

5

6

7

8

9

Current Path

[ ]

Sum: 0
Found Combinations (0)

Find combinations of 3 numbers that sum to 7

Variables
VariableValue
k3
n7
DepthFunction Call
Stack empty
0/252