Function aoc::year2019::day06::part2

source ·
pub fn part2(input: &[usize]) -> u16
Expand description

Trace Santa’s path all the way to the root COM object keeping track of distance. Then trace our path to the root. As soon as we encounter a non-zero distance then we’ve hit the first common ancestor and can calculate the required transfers.