Solve problem 74 using Rust.