You are viewing a single comment's thread. Return to all comments →
Hi akueisara39 : i appreciate your code as it appears to be out of box solution . but i feel it throws an exception when the number of shift operations is greater than the size(d>n) of the array so just added few lines of code to it .
int array = new int[n];
for(int i=0; i
array[(i+n-d)%n] = scan.nextInt();