To compare them for equality you need to sort them. However, the task was to generate the integers.
(If the example list of numbers was a part of the specification then we probably should not be considering seven digit integers as relevant.) Thanks, -- Raul On Tue, Aug 15, 2017 at 10:37 AM, Arie Groeneveld <agroeneveld...@gmail.com> wrote: > To compare both you need to do the following: > > 10 ts 'R=./:~,10#.(perms 7){"1/1+7 comb 9' > 0.0288779 2.4132e7 > 10 ts 'G=.,10 #. ((],"1 0 -."1)^:6 ,.)1+i.9' > 0.0258377 2.30737e7 > R-:G > 1 > > Looks like a draw. > > > Op 15-08-17 om 16:16 schreef Raul Miller: >> >> I cannot comment on elegance, but I can disagree about the efficiency >> issue: >> >> timespacex ',10#.(perms 7){"1/1+7 comb 9' >> 0.015591 2.15104e7 >> timespacex '10 #. (,/@:(],"1 0 -."1)^:6 ,.)1+i.9' >> 0.036695 3.7755e7 >> >> Thanks, >> > > ---------------------------------------------------------------------- > For information about J forums see http://www.jsoftware.com/forums.htm ---------------------------------------------------------------------- For information about J forums see http://www.jsoftware.com/forums.htm