given a linked list removerange function accepts a starting and ending index as parameters and removes the elements at those indexes inclusive from the list for example list 8 13 17 4 9 12 98 41 7 23 0 92 removerangelist 3 8 list becomes 8 13 17 23 0 92 legal range of the list 0 start index end index size of list case remove node at head move pointer to start position remove data until the end case remove node at head move pointer to start position remove data until the end
def remove_range(head, start, end):
    assert(start <= end)
    
    if start == 0:
        for i in range(0, end+1):
            if head != None:
                head = head.next
    else:
        current = head
        
        for i in range(0,start-1):
            current = current.next
        
        for i in range(0, end-start + 1):
            if current != None and current.next != None:
                current.next = current.next.next
    return head