<qiyuangong>019_Remove_Nth_Node_From_End_of_List_1.py
def removeNthFromEnd( head, n):
    index = []
    pos = head
    while pos is not None:
        index.append(pos)
        pos = pos.next
    ls = len(index)
    if n == ls:
        if ls > 1:
            return index[1]
        else:
            return None
    else:
        index_pos = ls - n - 1
        index[index_pos].next = index[index_pos + 1].next
        return head
def sample_funcname ( var_0 , var_1 ) :
    var_2 = [ ]
    var_3 = var_0
    while var_3 is not None :
        var_2.append ( var_3 )
        var_3 = var_3.next
    var_8 = len ( var_2 )
    if var_1 == var_8 :
        if var_8 > 1 :
            return var_2 [ 1 ]
        else :
            return None
    else :
        var_10 = var_8 - var_1 - 1
        var_2 [ var_10 ].next = var_2 [ var_10 + 1 ].next
        return var_0
