Sensei's Library, problem 125

Adapted from Beginner Exercise 125 · OpenContent License

All problems