Skip to content

Instantly share code, notes, and snippets.

@stephen-maina
Created August 24, 2018 08:52
Show Gist options
  • Save stephen-maina/f700d79b99d5130892851a441c032fae to your computer and use it in GitHub Desktop.
Save stephen-maina/f700d79b99d5130892851a441c032fae to your computer and use it in GitHub Desktop.
Codility Lesson 2
def solution(A, K):
outputArray=[0]*len(A);
for index in range(len(A)):
outputIndex=(index+K)%len(A);
outputArray[outputIndex]=A[index];
return outputArray;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment