def findMin(self, nums):
    if (not nums):
        return 0
    n = len(nums)
    total_sum = sum(nums)
    target = (total_sum // 2)
    dp = [([0] * (target + 1)) for _ in range(2)]
    (now, old) = (0, 0)
    for i in range(1, (n + 1)):
        old = now
        now = (1 - now)
        for j in range(0, (target + 1)):
            dp[now][j] = dp[old][j]
            if (j >= nums[(i - 1)]):
                dp[now][j] = max(dp[now][j], (dp[old][(j - nums[(i - 1)])] + nums[(i - 1)]))
    return (total_sum - (2 * max(dp[now])))
def findMin(self, nums):
    if (not nums):
        return 0
    n = len(nums)
    total_sum = sum(nums)
    target = (total_sum // 2)
    dp = [([0] * (target + 1)) for _ in range(2)]
    (now, old) = (0, 0)
    for i in range(1, (n + 1)):
        old = now
        now = (1 - now)
        for j in range(0, (target + 1)):
            dp[now][j] = dp[old][j]
            if (j >= nums[(i - 1)]):
                dp[now][j] = max(dp[now][j], (dp[old][(j - nums[(i - 1)])] + nums[(i - 1)]))
    return (total_sum - (2 * max(dp[now])))