66. Reverse the Queue

Acceptance — 0 accepted 0 submissions

Easy
ArraysTwo Pointers
No companies listed
In the school lunch queue, the teacher says: 'Today the last student goes first!' Reverse the order of the queue.

Given n roll numbers, print them in reverse order.

Input Format
The first line has n.
The second line has n integers.

Output Format
Print the n integers in reverse order, separated by single spaces.

Constraints
• 1 ≤ n ≤ 1000
• -10^9 ≤ value ≤ 10^9

Example 1

Input
5
10 20 30 40 50
Output
50 40 30 20 10

Explanation The last student, 50, now comes first.

Example 2

Input
1
7
Output
7

Explanation One student, nothing to change.

Example 3

Input
4
1 2 2 1
Output
1 2 2 1

Explanation This queue reads the same both ways.

Acceptance —
Accepted 0
Submissions 0
Auto-save
Saved Ln 1, Col 1
Submit a solution to see its status here.
Input
Expected Output
50 40 30 20 10
No results yet
Run your code to test it against the sample cases.
Problem List