add nested int weighted sum in linkedin