010: Solve in Python, simplify some ops in C and Rust