Skip to content

Instantly share code, notes, and snippets.

@kninami
Created October 25, 2016 01:41
Show Gist options
  • Select an option

  • Save kninami/53ae5eeb885e9c3ce84b7caa2c5af778 to your computer and use it in GitHub Desktop.

Select an option

Save kninami/53ae5eeb885e9c3ce84b7caa2c5af778 to your computer and use it in GitHub Desktop.
class Solution {
public int[] solution(int[] A, int K) {
int[] B = new int[A.length];
for(int i=0; i<A.length; i++){
B[(i+K)%A.length] = A[i];
}
return B;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment