Enable Javascript in your browser and then refresh this page, for a much enhanced experience.
DP solution in Clear category for Loading Cargo by gyahun_dash
def checkio(data): #dynamic programming
sumdata, outputs = sum(data), {0}
for n in data: outputs |= {m + n for m in outputs if m + n <= sumdata // 2}
return sumdata - 2 * max(outputs)
March 26, 2014
Comments: