Pergunta de entrevista da empresa Microsoft

Typical array manipulation from leetcode