Add #47 Ruby solution