My attempt fails with a stack error after about power of 25, so I cannot
use it to solve day 10, really.

The code below can be used as follows, but 40 cannot replace 25. I tried M.
but with no effect. Any other recommendations would be appreciated.

NB. v ^: (25) 3 1 1 3 3 2 2 1 1 3

Notice that I elected to use 3 1 1 3 3 2 2 1 1 3 to start and I noticed
others some chose to use instead of 1 1 1 3 2 2 2 1 1 3 (I think Henry has
a typo in his version, btw). I don't understand why that choice was made.



m66 =: 1 ,~ 2 ~:/\ ]
headNo =: (1 + (i.&1))@m66
head =: headNo{.]
tail =: headNo}.]
next =: headNo , ({.@head)
v =: ]`(1,])`($:@:tail,~next)@.(2<.#)


On Thu, Dec 10, 2015 at 4:29 PM, Henry Rich <henryhr...@gmail.com> wrote:

> We all had the same solution.  My version is
>
> # ,@((# , {.);.1~ (~: |.!.0))^:40 "."0 '1113122113'
>
> Henry Rich
>
>
>
-- 
(B=)
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm

Reply via email to