• + 0 comments

    array[(i+n-d)%n] = scan.nextInt();

    How did you come up with this idea? I was puzzled with this task for two days and still didn't succeed in it...