Function mbryant_aoc2021::day18::magnitude
source · [−]Expand description
Compute the magnitude by recursively computing the magnitude for each depth.
For this problem, this is a bit overkill, since the highest magnitude numbers will always
be full (2^MAX_DEPTH
elements), meaning a recursive approach splitting the number in half
each time would work equivalently well. That felt a bit too hacky to me though.