Reverse an array without using built-in helper functions.
Implement reverse_array(nums) to reverse the input list in place and return the same list. Do not use reverse(), reversed(), slicing, or other built-in reversal helpers. The input may be empty and can contain integers.
def reverse_array(nums):