Ruby warrior code (playing the "intermediate" level) from dojo at work