Enable Javascript in your browser and then refresh this page, for a much enhanced experience.
3-liner: squeeze solution in Creative category for Loading Cargo by przemyslaw.daniel
from itertools import permutations as pm, product as pd
checkio = lambda d: min([sum(d)]+[abs(d[0]+sum(i[:j])-sum(i[j:]))
for i, j in pd(pm(d[1:]), range(len(d[1:])))])
May 27, 2017