Take the ith number as the first element, then the original problem can be turned into find the solution for the new target: ** target - candidates[i]** in

**. Recursively doing this until the target is smaller or equal than 0.**

*candidate[i:]*```
class Solution(object):
def combinationSum(self, candidates, target):
"""
:type candidates: List[int]
:type target: int
:rtype: List[List[int]]
"""
if target > 0:
return [[candidates[i]]+s for i in range(len(candidates)) for s in self.combinationSum(candidates[i:], target-candidates[i])]
elif target < 0:
return []
else:
return [[]]
```