Skip to content

Latest commit

 

History

History
20 lines (16 loc) · 422 Bytes

File metadata and controls

20 lines (16 loc) · 422 Bytes

Reverse An Array

Easy


  1. You are given a number n, representing the size of array a.
  2. You are given n numbers, representing elements of array a.
  3. You are required to reverse the contents of array a.

Example 1:

Input:  n = 5, a[] = {1, 2, 3, 4, 5}  
Output:  a[] = {5, 4, 3, 2, 1}

Constraints:

0 <= n < 10^4
-10^9 <= a[i] <= 10^9