#C3374. Reverse Array In-Place
Reverse Array In-Place
Reverse Array In-Place
Given an array of integers, your task is to reverse the array in-place. The input will begin with an integer n indicating the number of elements in the array, followed by a line of n space-separated integers. Your program should output the reversed array as a single line of space-separated integers.
Note: The reversal must be done in-place, meaning you are not allowed to create another array as a copy for reversal.
Example:
Input: 5 1 2 3 4 5</p>Output: 5 4 3 2 1
inputFormat
The first line of input contains a single integer n (1 ≤ n ≤ 105), which represents the number of elements in the array. The second line contains n space-separated integers. Each integer will have an absolute value not exceeding 109.
outputFormat
Output a single line containing the n integers of the reversed array, separated by a single space.
## sample5
1 2 3 4 5
5 4 3 2 1