def subset_sum(x, R):
    b = [False] * (R + 1)
    b[0] = True
    for xi in x:
        for s in range(R, xi - 1, -1):
            b[s] |= b[s - xi]
    return b[R]
# snip}


# snip{ coinchange
Subsetsum
dataset/ETHPy150Open jilljenn/tryalgo/tryalgo/subsetsum.py/subset_sum