Amazon interview question

Mainly questions about array manipulation.