• + 0 comments

    js solution function deleteNode(llist, position) { // Write your code here
    let currentNode = llist;

    if (position===0) {
    
         llist=llist.next;
         return 
    
    };
    
    for (let i = 0; i < position - 1; i++) {
    
        currentNode = currentNode.next;
    
    }
    

    currentNode.next=currentNode.next.next

    return llist

    }