Backtrack with choices to reuse a candidate any number of times.
Sort candidates. DFS with (index i, remaining rem):
candidates[i] (stay at i to allow reuse).i+1).This explores all non-decreasing combinations; staying at i enables unlimited reuse without permutations.
Backtrack with choices to reuse a candidate any number of times.
Sort candidates. DFS with (index i, remaining rem):
candidates[i] (stay at i to allow reuse).i+1).This explores all non-decreasing combinations; staying at i enables unlimited reuse without permutations.