Tap here to switch tabs
Problem
Submissions

Problem: Remove Zero Sum Consecutive Nodes from Linked List

Try to solve the Remove Zero Sum Consecutive Nodes from Linked List problem.

Statement

Given the head of a linked list, repeatedly remove consecutive sequences of nodes whose values sum to 00 until no such sequences remain.

Return the head of the resulting linked list.

Note: If there are multiple possible answers, you may return any of them.

Constraints:

  • The number of nodes in the linked list is in the range [1,1000][1, 1000].

  • −1000≤-1000 \leq node.val ≤1000\leq 1000

⋮
Tap here to switch tabs
Problem
Submissions

Problem: Remove Zero Sum Consecutive Nodes from Linked List

Try to solve the Remove Zero Sum Consecutive Nodes from Linked List problem.

Statement

Given the head of a linked list, repeatedly remove consecutive sequences of nodes whose values sum to 00 until no such sequences remain.

Return the head of the resulting linked list.

Note: If there are multiple possible answers, you may return any of them.

Constraints:

  • The number of nodes in the linked list is in the range [1,1000][1, 1000].

  • −1000≤-1000 \leq node.val ≤1000\leq 1000