Enable Javascript in your browser and then refresh this page, for a much enhanced experience.
First solution in Uncategorized category for Loading Cargo by Moff
from itertools import combinations
def checkio(a):
min_diff = sum(a)
for i in range(len(a)):
for c in combinations(a, i):
min_diff = min(min_diff, abs(sum(a) - 2 * sum(c)))
return min_diff
Aug. 20, 2015
Comments: