Pregunta de entrevista de Allied Telesis

standard leetcode question with arrays