Visier interview question

implement an array manipulation algorithm