add problem 8 ruby solution.