Tag Info

Hot answers tagged

1

Just a quick cigar-smoking interpretation to point you toward a more Mathematica flavored way. A bit cleaner (IMO), and much faster. Does not check for length <2, etc., so add that. With[{r = Range@Length@#, t = #, n = Length@# - 1}, DeleteDuplicates /@ Last@Reap[Scan[(Sow[Times @@ t[[#]], 1]; Sow[Times @@ t[[Complement[r, #]]]]) &, ...


1

Working with a new Mathematica session and cleaning up your code to pickTwoParts[parts_] := Module[{par1, par2, i}, If[Length[parts] < 2, Return[{{}, {}}]]; par1 = {}; par2 = {}; For[i = 1, i <= Length[parts], i++, Module[{pr1, pr2, j, result}, pr1 = parts[[i]]; pr2 = 1; For[j = 1, j <= Length[parts], ...



Only top voted, non community-wiki answers of a minimum length are eligible