MOBIVITY interview question

solve array reversal without using extra variables