Write a function that returns the reverse of the input array.
Input specification:
Input1: an array of numbers
Input2: length of the array(input1)
Output Specification:
Return an array in reverse order.
Example 1:
Input 1: {1,2,3}
Input 2: 3
Output: {3,2,1}
Explanation:
The reverse of the array {1,2,3} will be {3,2,1}
Example 2:
Input 1: {4,6,7,2}
Input 2: 4
Output: {2,7,6,4}
Explanation:
The reverse of the array {4,6,7,2} will be {2,7,6,4}
Solution in Python 3:
#https://codewindow.in
#join our telegram channel
arr = list(map(int, input().split()))
l=int(input())
a = arr[::-1]
for i in a:
print(i,end=' ')
# Telegram @codewindow
Solution in JAVA :
//https://codewindow.in
//join our telegram channel @codewindow
import java.io.*;
import java.lang.*;
import java.util.*;
class CodeWindow {
public static void main(String[] args) throws Exception
{
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
String arr[] = br.readLine().split(" ");
int n = Integer.parseInt(br.readLine());
int nums[] = new int[arr.length];
for(int i=0;i<arr.length;i++)
nums[i] = Integer.parseInt(arr[i]);
for(int i=nums.length-1;i>=0;i--)
System.out.print(nums[i] + " ");
}
}

Solution in C++ :
//https://codewindow.in
//join our telegram channel @codewindow
#include <bits/stdc++.h>
#include <iostream>
using namespace std;
int main()
{
int input;
vector<int> arr;
while(cin >> input)
arr.push_back(input);
for(int i=arr.size()-2;i>=0;i--)
cout << arr[i] << " ";
return 0;
}
Output:
3 2 1 4 5
5
5 4 1 2 3