50. Reverse an Array
EasyArrayTwo Pointers
Print the elements of the array in reverse order.
Input format
Line 1: n Line 2: n integers
Output format
The reversed array, space-separated.
Example 1
Input
4 1 2 3 4
Output
4 3 2 1
Example 2
Input
1 9
Output
9
Constraints
1 ≤ n ≤ 10⁵
Read input from standard input and print the answer to standard output. Your code is judged against 5 test cases, most of them hidden.
Loading the MyLoginn IDE…