problem 80 in Ruby