Given an array of distinct integers candidates and
a target integer target, return all unique combinations
of candidates where the chosen numbers sum to target.
The same number may be chosen from candidates an unlimited number of times.
Input: [2,3,6,7] 7 Output: [[2,2,3],[7]]
Print the result as a JSON array of arrays. Order does not matter.
No submissions yet.
Discuss backtracking, recursion depth, pruning, and complexity.