Pregunta de entrevista de Palantir Technologies

Algorithm question with stocks