EAB interview question

Simple array manipulation