Finish problem 17 Ruby