EasyArray· 74% acceptance
#117

Reverse Array 12

Easy

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

Example 1

Input: nums = [12,13,14,15,16,17,18,19,20,21,22,23,24,25,26]

Output: [26,25,24,23,22,21,20,19,18,17,16,15,14,13,12]

Constraints

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

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

reverseArray

← All practice problems