Subset sum problem: Difference between revisions
m
→{{header|Sidef}}: updated code
m (→{{header|Sidef}}: optimization: short-circuit when a subset is found) |
m (→{{header|Sidef}}: updated code) |
||
Line 1,477:
for n in (1 .. weights.end) {
var found = false
weights.combinations(n, {|*comb|
if (comb.sum == 0) {
say "Length #{n}: "+" ".join(inverse{comb...})
|