Enable Javascript in your browser and then refresh this page, for a much enhanced experience.
First solution in Clear category for Loading Cargo by pohmelie
import itertools
def checkio(data):
ans = mass = sum(data)
for comb in itertools.product((0, 1), repeat=len(data)):
ans = min(ans, abs(mass - 2 * sum(itertools.compress(data, comb))))
return ans
May 29, 2014
Comments: