Pregunta de entrevista de Oracle

Easy-mid leetcode type question about arrays.