problem 99 in Ruby