Add solution for problem 04 in Ruby.