def deleteNode(head, position):
    if head is None:
        return None
    elif position == 0:
        head = head.next
        return head
    else:
        p = head
        b = None
        i = 0
        while i < position:
            b = p
            p = p.next
            i += 1
        b.next = p.next
        p.next = None
        return head

1921cb3a48e0fbefee92420870c4500470d7a284
<mask token>

def deleteNode(head, position):
    if head is None:
        return None
    elif position == 0:
        head = head.next
        return head
    else:
        p = head
        b = None
        i = 0
        while i < position:
            b = p
            p = p.next
            i += 1
        b.next = p.next
        p.next = None
        return head
