Pergunta de entrevista da empresa Palantir Technologies

Algorithm question with stocks