@@ -0,0 +1,760 @@
+class Solution:%0A    # @param %7Binteger%5B%5D%7D candidates%0A    # @param %7Binteger%7D target%0A    # @return %7Binteger%5B%5D%5B%5D%7D%0A    def combinationSum(self, candidates, target):%0A        candidates.sort()%0A        return self.combsum(candidates, target)%0A        %0A    def combsum(self, nums, target):%0A        if target == 0:%0A            return %5B%5B%5D%5D%0A        if not nums or nums%5B0%5D %3E target or target %3C 1:%0A            return %5B%5D%0A%0A        res = %5B%5D%0A        for i in range(len(nums)):%0A            num = nums%5Bi%5D%0A            pre = %5Bnum%5D%0A            t = target%0A            while t %3E= num:%0A                t -= num%0A                subs = self.combsum(nums%5Bi + 1:%5D, t)%0A                for sub in subs:%0A                    res.append(pre + sub)%0A                pre += %5Bnum%5D%0A        return res%0A

Create CombinationSum_001.py