Pregunta de entrevista de Microsoft

questions was about algorithm with array manipulation