#!/usr/bin/env python3
def SubsetSum(X,T):
if T == 0:
return true
elif T<0 or len(X) == 0:
return False
(y,rest) = (X[0],X[1:])
return SubsetSum(rest, T-y) \
or SubsetSum(rest,T)
#!/usr/bin/env python3
def SubsetSum(X,T):
if T == 0:
return true
elif T<0 or len(X) == 0:
return False
(y,rest) = (X[0],X[1:])
return SubsetSum(rest, T-y) \
or SubsetSum(rest,T)