Add #9 Ruby solution