Re:Advent of Code 2021
by regulation_d on Wednesday December 01, 2021 @02:19PM
(#29407946)
I really enjoy doing these problems in Elixir, but the fact that the default collection type is a linked list makes certain problems difficult. However, Erlang does have a fifo queue (a doubly linked list), which can be helpful and let's you practice some Erlang interop while you're at it. https://www.erlang.org/doc/man/queue.html
[ Parent
| on HN ]
Re:Advent of Code 2021
by princemaple on Wednesday December 01, 2021 @10:47PM
(#29412340)
queue in erlang is a tuple with 2 lists. it reverses the items in one list and put them in the other, if the second was empty, when you try to access the head of the queue. new items still goes into the first list.