Amazon interview question

Basic coding questions, array manipulation