• + 1 comment

    Thanks bro, it mathematical approach I like it. but i thing you done misticks in this code? for (int oldIndex = 0; oldIndex < n; oldIndex++) { int newIndex = (oldIndex + d) % n; rotArray[newIndex] = a[oldIndex]; }