This function rotates a linked list counter - clockwise and updates the head . The function assumes that k is smaller than size of linked list .
def rotate ( head_ref , k ) : NEW_LINE INDENT if ( k == 0 ) : NEW_LINE INDENT return NEW_LINE DEDENT DEDENT