Grab Interview Question

array manipulation problem- online test