<qiyuangong>039_Combination_Sum_1.py
def combinationSum( candidates, target):
    candidates.sort()
    dp = [[] for _ in range(target + 1)]
    dp[0].append([])
    for i in range(1, target + 1):
        for j in range(len(candidates)):
            if candidates[j] > i:
                break
            for k in range(len(dp[i - candidates[j]])):
                temp = dp[i - candidates[j]][k][:]
                if len(temp) > 0 and temp[-1] > candidates[j]:
                    continue
                temp.append(candidates[j])
                dp[i].append(temp)
    return dp[target]
def sample_funcname ( var_0 , var_1 ) :
    var_0.sort ( )
    var_6 = [ [ ] for var_3 in range ( var_1 + 1 ) ]
    var_6 [ 0 ].append ( [ ] )
    for var_9 in range ( 1 , var_1 + 1 ) :
        for var_11 in range ( len ( var_0 ) ) :
            if var_0 [ var_11 ] > var_9 :
                break
            for var_12 in range ( len ( var_6 [ var_9 - var_0 [ var_11 ] ] ) ) :
                var_13 = var_6 [ var_9 - var_0 [ var_11 ] ] [ var_12 ] [ : ]
                if len ( var_13 ) > 0 and var_13 [ - 1 ] > var_0 [ var_11 ] :
                    continue
                var_13.append ( var_0 [ var_11 ] )
                var_6 [ var_9 ].append ( var_13 )
    return var_6 [ var_1 ]
