C++ | Easy to understand | Linked List
\nclass Solution {\npublic:\n    ListNode* mergeNodes(ListNode* head) {\n        ListNode* res = new ListNode(0);\n        ListNode* ret = res;\n        int sm 
```\nclass Solution {\npublic:\n    ListNode* mergeNodes(ListNode* head) {\n        ListNode* res = new ListNode(0);\n        ListNode* ret = res;\n        int sm = 0;\n        head = head->next;\n        \n        while(head != NULL){\n            if(head->val == 0){\n                res->next = new ListNode(sm);\n                res = res->next;\n                sm = 0;\n            } else {\n                sm += head->val;\n            }\n            head = head->next;\n        }\n        \n        return ret->next;\n    }\n};\n```
['Linked List']