GlobalLogic interview question

Reverse an array without using extra space