EASY BOYS | C++
Intuition\n Describe your first thoughts on how to solve this problem. \n\n# Approach\n Describe your approach to solving the problem. \n\n# Complexity\n- Time 
# Intuition\n<!-- Describe your first thoughts on how to solve this problem. -->\n\n# Approach\n<!-- Describe your approach to solving the problem. -->\n\n# Complexity\n- Time complexity:\n<!-- Add your time complexity here, e.g. $$O(n)$$ -->\n    O(n)\n- Space complexity:\n<!-- Add your space complexity here, e.g. $$O(n)$$ -->\n\n# Code\n```\nclass Solution {\npublic:\n    ListNode* mergeNodes(ListNode* head) {\n        ListNode* res = new ListNode(0);\n        ListNode* list = res;\n        int b=0;\n        head = head->next;\n        while(head) {\n            b = b + head->val;\n            if(head->val == 0) {\n                ListNode* temp = new ListNode(b);\n                list->next = temp;\n                list = list->next;\n                b=0;\n            }\n            head = head->next;\n        }\n        return res->next;\n    }\n};\n```
['C++']