public static void Main()
Console.WriteLine("Hello World");
int[] a = new int[] { 1, 2, 3, 4, 5, 6, 7 };
Console.WriteLine("RotatedArray: {0}", string.Join(",", RotateArray(a, 3)));
private static int[] RotateArray(int[] a, int k)
Console.WriteLine("k: {0}", k);
for(int startIndex = 0; count < a.Length ; startIndex++)
Console.WriteLine("Start Index: {0}", startIndex);
var nextElementToSwap = a[startIndex];
var currentIndex = startIndex;
var runningIndex = (currentIndex + k) % a.Length;
Console.WriteLine("Running Index: {0}", runningIndex);
var temp = a[runningIndex];
a[runningIndex] = nextElementToSwap;
nextElementToSwap = temp;
currentIndex = runningIndex;
}while(currentIndex != startIndex);