Pregunta de entrevista de Palantir Technologies

Leetcode medium question about arrays