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