Adding Ruby solution to problem 1