• + 0 comments
    def deleteNode(llist, position):
        # Write your code here
        if position == 0:
            llist = llist.next
        else:        
            curr = llist
            while curr.next is not None and position > 1:
                curr = curr.next
                position -= 1
            if curr.next is not None:
                curr.next = curr.next.next
        return llist