package leetcode;

/**
 * https://leetcode.com/problems/remove-zero-sum-consecutive-nodes-from-linked-list/
 */
public class Problem1171 {
    public static class ListNode {
        int val;
        ListNode next;

        ListNode(int x) {
            val = x;
        }
    }

    public ListNode removeZeroSumSublists(ListNode head) {
        // TODO
        return null;
    }

    public static void main(String[] args) {
        Problem1171 prob = new Problem1171();
    }
}

@@ -384,93 +384,1498 @@
    p
-ublic static void main(String%5B%5D args) %7B%0A        Problem1171 prob = new Problem1171();
+rivate static void print(ListNode head) %7B%0A        for (ListNode n = head; n != null; n = n.next) %7B%0A            System.out.print(n.val + %22 %22);%0A        %7D%0A        System.out.println();%0A    %7D%0A%0A    public static void main(String%5B%5D args) %7B%0A        Problem1171 prob = new Problem1171();%0A%0A        ListNode head = new ListNode(1);%0A        head.next = new ListNode(2);%0A        head.next.next = new ListNode(-3);%0A        head.next.next.next = new ListNode(3);%0A        head.next.next.next.next = new ListNode(1);%0A        print(prob.removeZeroSumSublists(head)); // %5B3,1%5D%0A%0A        head = new ListNode(1);%0A        head.next = new ListNode(2);%0A        head.next.next = new ListNode(3);%0A        head.next.next.next = new ListNode(-3);%0A        head.next.next.next.next = new ListNode(4);%0A        print(prob.removeZeroSumSublists(head)); // %5B1,2,4%5D%0A%0A        head = new ListNode(1);%0A        head.next = new ListNode(2);%0A        head.next.next = new ListNode(3);%0A        head.next.next.next = new ListNode(-3);%0A        head.next.next.next.next = new ListNode(-2);%0A        print(prob.removeZeroSumSublists(head)); // %5B1%5D%0A%0A        head = new ListNode(3);%0A        head.next = new ListNode(4);%0A        head.next.next = new ListNode(5);%0A        head.next.next.next = new ListNode(-2);%0A        head.next.next.next.next = new ListNode(-3);%0A        head.next.next.next.next.next = new ListNode(2);%0A        head.next.next.next.next.next.next = new ListNode(6);%0A        print(prob.removeZeroSumSublists(head)); // %5B3, 2%5D
 %0A   

Update problem 1171