solved 40 in ruby