Reverse Array Problem

Reverse Array Problem — ExecCode School DSA Practice

Solve the Reverse Array problem on ExecCode. Free online school DSA practice in Arrays - Basics. Write and run code in Java, C++, Python — no signup required to run.

Problem description

You are given a list of numbers. Your task is to put these numbers in the exact opposite order. The number that was first should now be last, and the number that was last should now be first. Print the numbers in their new, reversed order.

Examples

Input 1 2 3 4 5; Output 5 4 3 2 1. Input 5 4 3 2 1; Output 1 2 3 4 5

Constraints

1 <= N <= 10^4

Practice Reverse Array free on ExecCode. Browse DSA problems, topic map, and placement guides.