Subset sum problem: Difference between revisions

Content deleted Content added
Updated D entry
Line 276:
if (reduce!q{ a + b[1] }(0, comb) == 0) {
writefln("A subset of length %d: %s", n,
//comb.map!q{ a[0] }().join(", "));
comb.map!q{ cast()a[0] }().join(", "));
return;
}
writefln("No solution found.");
}</lang>
{{out}}
Output:
<pre>A subset of length 2: archbishop, gestapo</pre>