HSBC Interview Question

One simple array rearrangement question