Reverse Array In-Place

Given an array, reverse its elements in-place.

Input Format

nums = array of integers

Output Format

nums array reversed

Constraints

  • 1 <= nums.length <= 10^5

Examples

Example 1:

Input:

nums = [1,2,3,4]

Output:

[4,3,2,1]

Explanation:

Reversed array.

Loading...
Reverse Array In-Place - Arrays DSA Problem