Created
August 24, 2018 08:52
-
-
Save stephen-maina/f700d79b99d5130892851a441c032fae to your computer and use it in GitHub Desktop.
Codility Lesson 2
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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