Reverse an Array
EasyArrayString
DescriptionWrite a function that takes an integer array nums as input and reverses the order of its elements in-place.The function should not return a new array; it should modify the original input array.The solution should run in $O(n)$ time complexity.The space complexity should be $O(1)$ (constant extra space).
Examples
Example 1
Input: [1,2,3,4,5,6]
Output: [6,5,4,3,2,1]