Shorter answer of Ruby Day 1, 3.rb