Solve problem 87 using Python/Rust.