Pergunta de entrevista da empresa Meta

Basic Python leetcode question asking for array manipulation