Sensei's Library, problem 12

Adapted from Beginner Exercise 12 · OpenContent License

All problems