Hello all I've been trying to dabble in J for quite some time, but I still haven't got the hang of it, so I'm trying (not for the first time) to go in deep trying to solve each day.
Alas sometimes it feels like hitting my head against the wall, and so I come to you with what I tried and what I lack to end the problem. Let's start. On day 1 we have an heterogeneous array, and we have to get the elf who carries the most calories. Using the example I can solve it for both parts of the day, using a boxed array. in=: 1000 2000 3000;4000;5000 6000;7000 8000 9000;10000 {. \:~>+/ each in 24000 +/ 3 {. \:~>+/ each in 45000 I can read the data from a file and I can also format it like in the instruction above p =: 1!:1<'test.input' p rplc (LF,LF);';';LF;' ' 1000 2000 3000;4000;5000 6000;7000 8000 9000;10000 But how do I go from one representation to the other? Or if there's another way to do this transformation I'm all eyes. I know that that is a string, and I know that numbers are different and I know of ". to transform to numbers. I don't know how to partition the input on something. Thanks. ---------------------------------------------------------------------- For information about J forums see http://www.jsoftware.com/forums.htm