static public void Main()
int[] test = {1, 2, 3, 4, 5};
Console.WriteLine("Array Rotation Input");
var result = RotateArray(test, 2);
Console.WriteLine("Array Rotation Output");
static void Print(int[] input)
for (int i = 0; i < input.Length; i++)
Console.Write(" " + input[i]);
static int[] RotateArray(int[] input, int rotations)
for(int i =0; i< rotations; i++){
input = RotateOnce(input);
static int[] RotateOnce(int[] input){
int temp = input[input.Length -1];
for(int i =input.Length -1 ; i > 0 ; i--){