PythiloMedium · 25 min · Task 74 of 100 · progress kept in this browser

Reusable combination sum

Return all nondecreasing combinations of unique positive candidates summing to nonnegative target, in lexicographic order. A candidate may be reused.

path, remaining, choice = [2], 5, 2
print(path+[choice], remaining-choice)
Your task

Return all nondecreasing combinations of unique positive candidates summing to nonnegative target, in lexicographic order. A candidate may be reused.