Combination Sum III

Medium · Backtracking · about 15 minutes

Asked at Google, Amazon, Microsoft, Meta.

Find all combinations of k distinct numbers from 1 to 9 that add up to n. Return them in any order; the values inside each combination may be in any order.

Related guides