static void Main(string[] args) { BinaryGap.Test(); CyclicRotation.Test(); OddOccurrencesInArray.Test(); TapeEquilibrium.Test(); PermCheck.Test(); FrogRiverOne.Test(); MissingInteger.Test(); }
public static void Test() { var random = new Random(); var N = random.Next(0, 100); var K = random.Next(0, 100); var A = new int[N]; for (int i = 0; i < N; i++) { A[i] = random.Next(-1000, 1000); } Console.WriteLine("======================="); Console.WriteLine("Cyclic Rotation Example"); Console.WriteLine("A: " + A.Select(num => num.ToString()).Aggregate((first, second) => first + ", " + second)); Console.WriteLine("K: " + K); var R = new CyclicRotation().Solution(A, K); Console.WriteLine("R: " + R.Select(num => num.ToString()).Aggregate((first, second) => first + ", " + second)); }