solved 36 in ruby