You are viewing a single comment's thread. Return to all comments →
This does the rotation in place. 1 line solution.
for (int i = d; i < d + n; i++) Console.Write($"{a[i%n]} ");
Seems like cookies are disabled on this browser, please enable them to open this website
Left Rotation
You are viewing a single comment's thread. Return to all comments →
This does the rotation in place. 1 line solution.
for (int i = d; i < d + n; i++) Console.Write($"{a[i%n]} ");