':type nums: List[int]
:type target: int
:rtype: int'

def combinationSum4(self, nums, target):

    dp = ([0] * (target + 1))
    dp[0] = 1
    nums.sort()
    for i in xrange(1, (target + 1)):
        for j in xrange(len(nums)):
            if (nums[j] <= i):
                dp[i] += dp[(i - nums[j])]
            else:
                break
    return dp[target]
