HSBC interview question

One simple array rearrangement question