Pregunta de entrevista de FactSet

How would you simplify this code?