Subset sum problem: Difference between revisions

Content deleted Content added
→‎{{header|C}}: Call it a set not path
Rdm (talk | contribs)
m J: mention why we are not showing all solutions here
Line 708: Line 708:
<lang J> words wsum0 numbs
<lang J> words wsum0 numbs
centipede markham mycenae</lang>
centipede markham mycenae</lang>

Note also that there are over 300,000 valid solutions here. More than can be comfortably displayed:

<lang J> Ps=: </.~ /:~ (I.P e. N){P
Ns=: </.~ /:~ (I.N e. P){N
+/#@,@{"1 Ps,.Ns
349168</lang>

(One of those is the empty solution, but the rest of them are valid.)


=={{header|Mathematica}}==
=={{header|Mathematica}}==