I have begun to punt on the aoc about here.
Even with this part a solution I got frustrated thinking about the parsing
of "operator" packets even on part a. Your explanation and code is very
informative. For example in this day 16 question the snippet below was very
satisfying because I could not see that the trick of reading 5 bits each
time would also deal with the leftover odd zero bits. My head hurt while
planning this code, so I just stopped.

 value=. i.0
       while. {. group=. bits 5 do.
         value=. value,}.group
       end.
       payload=. #.x:value,}.group

Your search for the shortest path on day 15 was way too difficult for me to
do in a reasonable time frame, also.

Thank you very much for creating these solution threads. Your explanations
are extremely valuable especially in their usage of arrays and j
primitives. I find that often you approach things from a different
perspective than I do. For example in this solution your parsing of BITS
relies on dfh and my bfh (below) is much different and more cumbersome, to
me.

bfh=:(_4*#){.#:&".@('16b'&,@tolower)


-- 
(B=)
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm

Reply via email to