<qiyuangong>092_Reverse_Linked_Lis_ II_1.py
def reverseBetween( head, m, n):
    if m == n:
        return head
    split_node, prev, curr = None, None, head
    count = 1
    while count <= m and curr is not None:
        if count == m:
            split_node = prev
        prev = curr
        curr = curr.next
        count += 1
    tail, next_node = prev, None
    while curr is not None and count <= n:
        next_temp = curr.next
        curr.next = prev
        prev = curr
        curr = next_temp
        count += 1
    if split_node is not None:
        split_node.next = prev
    if tail is not None:
        tail.next = curr
    if m == 1:
        return prev
    return head
def sample_funcname ( var_0 , var_1 , var_2 ) :
    if var_1 == var_2 :
        return var_0
    var_4 , var_5 , var_6 = None , None , var_0
    var_8 = 1
    while var_8 <= var_1 and var_6 is not None :
        if var_8 == var_1 :
            var_4 = var_5
        var_5 = var_6
        var_6 = var_6.next
        var_8 += 1
    var_10 , var_11 = var_5 , None
    while var_6 is not None and var_8 <= var_2 :
        var_12 = var_6.next
        var_6.next = var_5
        var_5 = var_6
        var_6 = var_12
        var_8 += 1
    if var_4 is not None :
        var_4.next = var_5
    if var_10 is not None :
        var_10.next = var_6
    if var_1 == 1 :
        return var_5
    return var_0
