solved problem 63 again in ruby