QM21A Editorial

PROBLEM LINK:

Practice
Contest

Author: Chandan Boruah
Tester: Harsh Raj
Editorialist: Chandan Boruah

DIFFICULTY:

SIMPLE

PREREQUISITES:

Brute Force.

PROBLEM:

Given an array find numbers to add to the array such that the array reads the same from first to last and last to first elements, a “palindrome array”. Only numbers in the array can be used, and each number exactly once.

QUICK EXPLANATION:

Reverse the array and print it.

EXPLANATION:

SInce on reversing the array, and adding those numbers to the array creates a palindrome array, print the reverse of the array.

SOLUTIONS:

chandubaba's Solution
using System;
using System.Collections.Generic;
class some
{
	public static void Main()
	{
		int n=int.Parse(Console.ReadLine());
		int[]arr=new int[n];
		string[]ss=Console.ReadLine().Split();
		Array.Reverse(ss);
		for(int i=0;i<ss.Length;i++)
		{
			if(i>0)Console.Write(" ");
			Console.Write(ss[i]);
		}
		Console.WriteLine();
	}
}
harshraj22's Solution
n = input()
arr = input().split()
print(*arr[::-1])