Microsoft Interview Question

Array manipulation question