This topic is about Day 22 of the Advent of Code 2021.
We have a private leaderboard (shared with users of Erlang Forums):
https://adventofcode.com/2021/leaderboard/private/view/370884
The entry code is:
370884-a6a71927
This topic is about Day 22 of the Advent of Code 2021.
We have a private leaderboard (shared with users of Erlang Forums):
https://adventofcode.com/2021/leaderboard/private/view/370884
The entry code is:
370884-a6a71927
Here is my solution:
Here’s mine
I see you are using ranges I don’t even understand properly what Range.disjoint?
means. So I just wrote all the cases. It’s still short enough.
Anyway here is my version, I’m splitting cubes too : adventofcode/day_22.ex at main · lud/adventofcode · GitHub
It took a couple minutes to run, but when I removed all IO.inspect and other printouts, it runs in 23ms
It’s very infortunate that max
contains the letter “x” so instead of using xmax
names I used xi
and xo
for minimum x and maximum x, respectively. (“i” as in “min” and “o” for omega ).
I did absolutely enjoy today, especially that AHA moment that I got after coming up with a possible solution in my head. That said the cube splitting took a while to properly implement.