Combination Sum

medium
Unit 16 · Backtracking0/3 to milestone

Given distinct positive candidates and a target, return all unique combinations that sum to the target, where each candidate may be used any number of times. Each combination is a non-decreasing list; return them sorted.

Then implement combination_sum_once(candidates, target): candidates may contain duplicates and each element can be used at most once; no duplicate combinations.

#backtracking2 visible + 1 hidden tests
solution.py · Python 3.13
Loading editor…
Run your code to see results. ⌘↵ to run · ⌘⇧↵ to submit
Combination Sum · TechGradify