Implement reverse_array(arr), returning the reversed array while modifying the input list in place. The input is a list of integers, and the output is the same list after reversal.
Constraints
0 <= len(arr) <= 1000
-10^9 <= arr[i] <= 10^9
The reversal must modify the input list in place
Return the modified list
Function Signature
defreverse_array(arr):
Interviewer
Whenever you're ready, walk me through your approach or go straight to the code. The requirements are in the Question tab.