Pregunta de entrevista de Palantir Technologies

The programming exercise was a typical algorithmic problem