solved problem 67 again in ruby