':type head: ListNode
:type k: int
:rtype: ListNode'

def rotateRight(self, head, k):

    if ((not head) or (not head.next)):
        return head
    (n, cur) = (1, head)
    while cur.next:
        cur = cur.next
        n += 1
    cur.next = head
    (cur, tail) = (head, cur)
    for _ in xrange((n - (k % n))):
        tail = cur
        cur = cur.next
    tail.next = None
    return cur
