We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
My code passes all test cases except 2nd, does anyone has this same issue? if not could please help?
def deleteNode(llist, position):
# Write your code here
current = llist;
if(current.next is not None):
for i in range(position-1):
if(current.next is not None):
current = current.next;
nodeToBeDeleted = current.next;
if(nodeToBeDeleted.next is not None):
current.next = nodeToBeDeleted.next;
nodeToBeDeleted.next = None;
else:
current.next = None;
else:
llist = None;
return llist;
Cookie support is required to access HackerRank
Seems like cookies are disabled on this browser, please enable them to open this website
Delete a Node
You are viewing a single comment's thread. Return to all comments →
My code passes all test cases except 2nd, does anyone has this same issue? if not could please help?
def deleteNode(llist, position): # Write your code here