Write code to reverse an array.
Implement reverse_array(arr) to reverse the given list in place and return the same list. The input is a list of integers, and the output is the reversed list. For example, [1, 2, 3] becomes [3, 2, 1], while [] remains [].
def reverse_array(arr):