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
Your question is Reverse an Array With Python. Start with the requirements in the Question tab.
Run and submit as often as you like. When you're ready, talk me through your approach or go straight to the code.