Solve problem 48 using Rust.