Skip to content

#39 - Combination Sum

MediumBacktracking
Open on LeetCode

Given an array of distinct integers candidates and a target, return all unique combinations where the chosen numbers sum to target. The same number may be chosen an unlimited number of times. Combinations are returned in any order.

InputOutput
candidates = [2,3,6,7], target = 7[[2,2,3],[7]]
candidates = [2,3,5], target = 8[[2,2,2,2],[2,3,3],[3,5]]

Released under the MIT License.