Skip to content

Commit 243a3e4

Browse files
Delete Node in Linked List Solution
1 parent 78758f8 commit 243a3e4

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

Diff for: 0237-Delete-Node-in-a-Linked-List.py

+3-5
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,8 @@
2525
Do not return anything from your function.
2626
'''
2727

28+
# Solution by modifying in Place
29+
2830
# Definition for singly-linked list.
2931
# class ListNode:
3032
# def __init__(self, x):
@@ -33,8 +35,4 @@
3335

3436
class Solution:
3537
def deleteNode(self, node):
36-
"""
37-
:type node: ListNode
38-
:rtype: void Do not return anything, modify node in-place instead.
39-
"""
40-
node.val, node.next = node.next.val, node.next.next
38+
node.val, node.next = node.next.val, node.next.next

0 commit comments

Comments
 (0)