Write a program to reverse an array.
Implement reverse_array(arr) to reverse the elements in place and return the same array object. The input is a mutable list, and the output must contain the elements in reverse order without creating another array.
Example: arr = [1, 2, 3, 4] produces [4, 3, 2, 1]. An empty array and a single-element array should remain unchanged.
def reverse_array(arr):