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 🦆

right, we can write imperative code in ocaml that's just... not what we're here for :P also I just realized the deque/dynarray isn't even needed, could just be incrementing an index into the sorted ranges (as a regular array/vector) /facepalm

0 reposts0 likes

No replies yet.