Sensei's Library, problem 143

Adapted from Beginner Exercise 143 · OpenContent License

All problems