• + 15 comments

    Good thinking! I guess it could be handled with another array logically. My two cents.

        ......
        int[] getArray = new int[n];
        for (int i = 0; i < n; i++) {
            getArray[i] = scan.next();
        }
        for (int i = 0; i < n; i++) {
            array[(i + n - d) % n] = getArray [i];
        }
        for(int i = 0; i < n; i++) {
            System.out.print(array[i] + " ");
        }