Function aoc::year2022::day25::to_snafu

source ยท
fn to_snafu(n: i64) -> String
Expand description

Convert to decimal by first finding the result modulus 5 for each digit. If the answer is 3 or 4 then we must add a carry to the next digit so account for the subtraction.