/******************************************************************************
Online C# Compiler.
Code, Compile, Run and Debug C# program online.
Write your code in this editor and press "Run" button to execute it.
*******************************************************************************/
using System;
class HelloWorld {
public static void ShiftLeft(int[] arr)
{
int length =arr.Length-1;
int temp = arr[length];
for (int i=length; i > 0; i--)
{
arr[i] = arr[i-1];
}
arr[0] =temp;
}
public static bool Beautiful(int[] arr)
{
int Left=0;
int Right = arr.Length -1;
while(Left < Right)
{
if (arr[Left] != arr[Right])
return false;
else
{
Left++;
Right--;
}
}
return true;
}
static void Main() {
Console.WriteLine("Hello World");
int[] arr = {1,3,11};
bool b = Beautiful(arr);
Console.WriteLine("b:{0}",b);
ShiftLeft(arr);
for (int i=0; i <arr.Length; i++)
{
Console.Write("{0} ",arr[i]);
}
}
}