Skip to content

Instantly share code, notes, and snippets.

@empeje
Last active December 17, 2017 11:13
Show Gist options
  • Save empeje/b7d387976221144a0ba4804934ef49bb to your computer and use it in GitHub Desktop.
Save empeje/b7d387976221144a0ba4804934ef49bb to your computer and use it in GitHub Desktop.
[SNIPPET-18] Codility - Cyclic Rotation
from collections import deque
# you can write to stdout for debugging purposes, e.g.
# print "this is a debug message"
def solution(A, K):
# write your code in Python 2.7
d=deque(A)
d.rotate(K)
return list(d)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment