#K95727. Reverse Array
Reverse Array
Reverse Array
You are given an array of N integers. The task is to reverse the order of the array and print the elements separated by a space. This is a basic problem that tests your ability to manipulate arrays.
Formally, if the array is $$A = [a_1, a_2, \dots, a_N]$$ then your program should output $$[a_N, a_{N-1}, \dots, a_1]$$. Make sure to handle edge cases like an array of one element.
inputFormat
The first line contains a single integer N which represents the number of elements in the array. The second line contains N space-separated integers representing the elements of the array.
outputFormat
Output the reversed array as a single line of N space-separated integers.## sample
4
1 2 3 4
4 3 2 1