Skip to content

Commit 698054c

Browse files
committed
Runtime: 59 ms (Top 77.27%) | Memory: 14.3 MB (Top 57.10%)
1 parent 1af9698 commit 698054c

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

scripts/algorithms/R/Remove Zero Sum Consecutive Nodes from Linked List/Remove Zero Sum Consecutive Nodes from Linked List.py

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
1+
# Runtime: 59 ms (Top 77.27%) | Memory: 14.3 MB (Top 57.10%)
2+
13
# Definition for singly-linked list.
24
# class ListNode:
3-
# def __init__(self, val=0, next=None):
4-
# self.val = val
5-
# self.next = next
5+
# def __init__(self, val=0, next=None):
6+
# self.val = val
7+
# self.next = next
68
class Solution:
79
def removeZeroSumSublists(self, head: Optional[ListNode]) -> Optional[ListNode]:
810
root = ListNode(0,head)
@@ -22,5 +24,5 @@ def removeZeroSumSublists(self, head: Optional[ListNode]) -> Optional[ListNode]:
2224
else:
2325
d[summ] = node
2426
node = node.next
25-
26-
return root.next
27+
28+
return root.next

0 commit comments

Comments
 (0)