Infineon Technologies engineers may need to reorder sampled data used by an AURIX microcontroller pipeline. Given an array of values, reverse its elements in place without using array-reversal helpers.
Implement reverse_array(arr) so that it rearranges arr into reverse order and returns the same array object. Do not use reversed(), slicing, .reverse(), sorting, or any library operation that directly reverses the array. Using indexing, len(), and a temporary variable is allowed.
arr, a mutable Python list containing integers.def reverse_array(arr):