Solve problem 78 using Rust.