Problem solution

Pretty easy assignment since they told you how to do it