Add solution for 10 in Ruby.