Pregunta de entrevista de Amazon

Solve a coding problem involving array manipulation under a timed online assessment