Function aoc::year2021::day18::magnitude

source ยท
fn magnitude(tree: &mut [i32; 63]) -> i32
Expand description

Calculate the magnitude of a snailfish number in place without using recursion.

This operation is destructive but much faster than using a recursive approach and acceptable as we no longer need the original snailfish number afterwards.