You are viewing a single comment's thread. Return to all comments →
I had a very similar solution. Why did you return via a for-loop instead of returning the array?
static int[] rotLeft(int[] a, int d) { Queue<int> z = new Queue<int>(a.ToList()); while (d-- > 0) { z.Enqueue(z.Dequeue()); } return z.ToArray(); }
Arrays: Left Rotation
You are viewing a single comment's thread. Return to all comments →
I had a very similar solution. Why did you return via a for-loop instead of returning the array?