Post

Advent of OCaml, day 5 done Whew. Getting the details right on this one took forever. Happy that the naive brute force solution (just construct a set in memory of the ingredients) couldn't be done and it required a bit more thinking.

At the risk of getting myself excommunicated from the OCaml community, day 5 is an example where imperative solution is easier to grok because there's no ready-made higher order function for the pattern you're employing. That is, IMO, this imperative C++ solution is clearer 🦆

I had a similar merge to you - I agree the stack is definitely easier to grok... I feel that way about a lot of the problems where a 'work queue' approach makes sense. Even the rolls one, I wanted to be able to enqueue any that became "accessible" when a cell was flipped, but I did passes instead

0 reposts1 like

No replies yet.