Ruby version of problem 11