<doocs>0416.Partition Equal Subset Sum_1.py
def canPartition( nums: List[int]) -> bool:
    s = sum(nums)
    if s % 2 != 0:
        return False
    n = s >> 1
    dp = [False] * (n + 1)
    dp[0] = True
    for v in nums:
        for j in range(n, v - 1, -1):
            dp[j] = dp[j] or dp[j - v]
    return dp[-1]
def sample_funcname ( var_0 : List [ int ] ) -> bool :
    var_5 = sum ( var_0 )
    if var_5 % 2 != 0 :
        return False
    var_10 = var_5 >> 1
    var_11 = [ False ] * ( var_10 + 1 )
    var_11 [ 0 ] = True
    for var_13 in var_0 :
        for var_15 in range ( var_10 , var_13 - 1 , - 1 ) :
            var_11 [ var_15 ] = var_11 [ var_15 ] or var_11 [ var_15 - var_13 ]
    return var_11 [ - 1 ]
