Sensei's Library, problem 145

Adapted from Beginner Exercise 145 · OpenContent License

All problems