2181. Merge Nodes in Between Zeros
Code\n\npublic class Solution {\n\n    public ListNode mergeNodes(ListNode head) {\n        ListNode modify = head.next;\n        ListNode current = modify;\n\n
# Code\n```\npublic class Solution {\n\n    public ListNode mergeNodes(ListNode head) {\n        ListNode modify = head.next;\n        ListNode current = modify;\n\n        while (current != null) {\n            int sum = 0;\n\n            while (current.val != 0) {\n                sum += current.val;\n                current = current.next;\n            }\n\n            modify.val = sum;\n\n            current = current.next;\n\n            modify.next = current;\n            modify = current;\n        }\n        return head.next;\n    }\n}\n\n```
['Java']