Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
# Definition for singly-linked list.
# class ListNode:
# def __init__(self, x):
# self.val = x
# = None
class Solution:
-we're not allowed to access head of linked list
-the node to be delted won't be the tail node
So, the node to be deleted must be in the 0,1,2,..,n-1
def deleteNode(self, node):
:type node: ListNode
:rtype: void Do not return anything, modify node in-place instead.
node.val =
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment