Pregunta de entrevista de Meta

Basic Python leetcode question asking for array manipulation