Easy solution using c++
class Solution {\n\npublic:\n\n    ListNode mergeNodes(ListNode head) {\n\t\n        ListNode temp= head;\n        ListNode naya = new ListNode(0);\n        Lis
class Solution {\n\npublic:\n\n    ListNode* mergeNodes(ListNode* head) {\n\t\n        ListNode* temp= head;\n        ListNode* naya = new ListNode(0);\n        ListNode* ans = naya;\n        temp=temp->next;\n        int sum=0;\n        while(temp )\n        {\n            \n            if(temp->val==0)\n            {\n               naya->next= new ListNode(sum);\n                naya=naya->next;\n                sum=0;\n            }\n            else{\n                sum+=temp->val;\n            }\n            temp=temp->next;\n        }\n        return ans->next;\n    }\n};
['C']