solved 32 in ruby