fork download
  1. def rotateArray(A, B):
  2. B=B%len(A)
  3. ret = []
  4. for i in range(0,len(A)-B):
  5. ret.append(A[i + B])
  6. for i in range(0,B):
  7. ret.append(A[i])
  8. return ret
  9. print rotateArray([ 44, 41, 12, 42, 71, 45, 28, 65, 75, 93, 66, 66, 37, 6, 24, 59 ],17)
Success #stdin #stdout 0.01s 7692KB
stdin
Standard input is empty
stdout
[41, 12, 42, 71, 45, 28, 65, 75, 93, 66, 66, 37, 6, 24, 59, 44]