Part 1 General case for ragged lines: +/ > (>./-<./)&". each cutopen toJ fread <'/home/line/day2inp'
Taking advantage of equal length rows: +/ (>./-<./)"1 ". > cutopen toJ fread <'/home/line/day2inp' Part 2 Counting and subtracting the extra ones in the diagonal of the division table: (*/$d2n) -~ +/ , (*(=<.)) %"0 1 ~ d2n =: ". > cutopen toJ fread <'/home/line/day2inp' On Sat, Dec 2, 2017 at 10:50 AM, Brian Schott <[email protected]> wrote: > For part b I just used table and then eliminated 1's and non-integer > results. > > +/,((=<.)#])@(-.&1@,@(%/~))@". ;._2 data > ---------------------------------------------------------------------- > For information about J forums see http://www.jsoftware.com/forums.htm > ---------------------------------------------------------------------- For information about J forums see http://www.jsoftware.com/forums.htm
