EasyArray· 64% acceptance
#107

Reverse Array 2

Easy

Reverse `nums` **in-place** and return the mutated array. Variant **#2**.

Example 1

Input: nums = [2,3,4,5,6]

Output: [6,5,4,3,2]

Constraints

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

Acceptance: 64% · Topics: array, two-pointers

reverseArray

← All practice problems