Elastica Interview Question

array manipulation