Pregunta de entrevista de Quantlab

How did you approach solving the problem?