Technovert Interview Question

Interchanging elements in an array