```
class Solution(object):
def combinationSum(self, candidates, target):
"""
:type candidates: List[int]
:type target: int
:rtype: List[List[int]]
"""
i, s, size = 0, 0, len(candidates)
indexList, tmpResult, result = [], [], []
while i < size:
tmpResult.append(candidates[i])
indexList.append(i)
s += candidates[i]
if s >= target:
if s == target:
result.append(tmpResult[:])
s -= tmpResult.pop()
i = indexList.pop()+1
while i == size and tmpResult:
s -= tmpResult.pop()
i = indexList.pop() + 1
return result
```