Atos interview question

array multiplication and then optimization