add problem 2 ruby solution.