Add problem 7 solution with Ruby.