Skip to content

Latest commit

 

History

History

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 

README.md

Arrays - DS

Reference: https://www.hackerrank.com/challenges/arrays-ds/problem

An array is a type of data structure thant stores elements of the same type in a contiguos block of memory, In an array, A, of size N, each memory location has some unique index, i (where 0 ≤ i < N), that can be referenced as A[i] (you may also see it written as Ai).

Given an array, A, of N integers, print each element in reverse order as a single line of space-separated integers.

Input Format

The first line contains an integer, N (the number of integers in A).

The second lien contains N space-separated integers describing A.

Constraints

  • 1 ≤ N ≤ 10^3
  • 1 ≤ A ≤ 10^4, where Ai is the ith integer in A

Output Format

Print all N integers in A in reverse order as a single line of space-separated integers.

Sample input 1

4
1 4 3 2

Sample output 1

2 3 4 1