Visier Interview Question

implement an array manipulation algorithm