Solve problem 26 using Rust.