Write a function reverse_array(arr) that reverses the elements of an array without using built-in reverse functions or slicing tricks like [::-1].
Example:
Input: arr = [1, 2, 3, 4, 5]
Output: [5, 4, 3, 2, 1]
Constraints:
Test Cases
Test Case 1
Input:
[1, 2, 3, 4, 5]Expected:
[5, 4, 3, 2, 1]Test Case 2
Input:
[10, 20, 30]Expected:
[30, 20, 10]Test Case 3
Input:
[7]Expected:
[7]+ 2 hidden test cases