IBM interview question

Rearrange and insert into an array.