Sensei's Library, problem 40

Adapted from Beginner Exercise 40 · OpenContent License

All problems