using System.Collections.Generic;
static void Main(string[] args)
Console.WriteLine("Enter the number and length of array space seperated...");
var data = Console.ReadLine().Trim(' ').Split(" ");
if (String.IsNullOrEmpty(data[0]))
Console.WriteLine("Incorrect number of parameters found...");
int num = Convert.ToInt32(data[0]);
int arrLength = Convert.ToInt32(data[1]);
int[] arr = new int[arrLength];
Console.WriteLine("Enter the parameters of array space seperated...");
var param = Console.ReadLine().Trim(' ').Split(" ");
if (param.Length < arrLength)
Console.WriteLine("Array parameters entered are less than the array length entered...");
for(int f = 0; f < arrLength; f++)
arr[l++] = Convert.ToInt32(param[f]);
Dictionary<String, int> lst = new Dictionary<string, int>();
for (int i = 0; i <= arr.Length - 1; i++)
for (j = i; j <= arr.Length - 1;)
x = String.Concat(x, " ", arr[j]);
else if (count > key.Value)
else if (count == key.Value)
var res = key.Key.Split(" ");
var ind = index.Split(" ");
for (int k = ind.Length - 1; k > 0; k--)
else if (Convert.ToInt32(ind[k]) < Convert.ToInt32(res[k]))
char[] charArray = index.ToCharArray();
Array.Reverse(charArray);
Console.WriteLine("Output:- ");
Console.WriteLine("1 " + new string(charArray));