13. Nov. 2020, 18:40 von [email protected]: > Having seen Henry's solution, I see that I have left the job half done, so > here is the rest of my solution. > > dyadind =. ;@:(= #"1 {@({@i."0 @$@])) > 6 dyadind i. 3 4 > 1 2 > > Having produced that, I note that Henry's is twice as fast and takes up half > the space and the differences become more apparent at higher dimensions. > > 1000 timespacex '6 dyadind i. 3 4' > 1.807e_6 4288 > 1000 timespacex '6 ($@] #: I.@(= ,)) i. 3 4' > 8.68e_7 2496 > 1000 timespacex '6 dyadind i. 2 3 3 4' > 5.283e_6 12992 > 1000 timespacex '6 ($@] #: I.@(= ,)) i. 2 3 3 4' > 1.05e_6 3008 > > Cheers, bob > Hello everyone,
as usual, I'm impressed by the speed, by which the forum provides help. I'll study the solutions provided in more detail, but, as it seems, Henry's approach works perfectly. Thanks again! Thomas ---------------------------------------------------------------------- For information about J forums see http://www.jsoftware.com/forums.htm
