2 Pointers || Linked list || Iterative
Intuition\n Describe your first thoughts on how to solve this problem. \nThe core intuition behind this solution is to recognize that the problem can be broken 
# Intuition\n<!-- Describe your first thoughts on how to solve this problem. -->\nThe core intuition behind this solution is to recognize that the problem can be broken down into manageable segments: summing the values between zero nodes and then creating a new linked list with these sums. By iterating through the linked list once and maintaining a running sum, we can efficiently compute the desired output.\n\n# Approach\n<!-- Describe your approach to solving the problem. -->\n\n\n# Complexity\n- Time complexity:\n<!-- Add your time complexity here, e.g. $$O(n)$$ -->\n        O(N)\n\n\n- Space complexity:\n<!-- Add your space complexity here, e.g. $$O(n)$$ -->\n        O(N)\n\n# Code\n```\n/**\n * Definition for singly-linked list.\n * struct ListNode {\n *     int val;\n *     ListNode *next;\n *     ListNode() : val(0), next(nullptr) {}\n *     ListNode(int x) : val(x), next(nullptr) {}\n *     ListNode(int x, ListNode *next) : val(x), next(next) {}\n * };\n */\nclass Solution {\npublic:\n    ListNode* mergeNodes(ListNode* head) {\n        \n         ListNode *dummy=new ListNode();\n         ListNode* c=head->next;\n         ListNode* p=dummy;\n         int s=0;\n        while(c)\n        {\n            s=0;\n            while(c && c->val!=0)\n            {\n                s+=c->val;\n                c=c->next;\n            }\n            p->next=new ListNode(s);\n            p=p->next;\n          \n           if(c)\n             c=c->next;\n\n        }\n        return dummy->next;\n\n    }\n};\n```
['Linked List', 'Two Pointers', 'C++']