FactSet interview question

one maths question which can be solved using two pointers optimization is crucia