JAVA Solution Explained in HINDI
https://youtu.be/mKo7laPqYbo\n\nFor explanation, please watch the above video and do like, share and subscribe the channel. \u2764\uFE0F Also, please do upvote 
https://youtu.be/mKo7laPqYbo\n\nFor explanation, please watch the above video and do like, share and subscribe the channel. \u2764\uFE0F Also, please do upvote the solution if you liked it.\n\n# Subscribe:- [ReelCoding](https://www.youtube.com/@reelcoding?sub_confirmation=1)\n\nSubscribe Goal:- 500\nCurrent Subscriber:- 478\n\n# Complexity\n- Time complexity: O(n)\n<!-- Add your time complexity here, e.g. $$O(n)$$ -->\n\n- Space complexity: O(n)\n<!-- Add your space complexity here, e.g. $$O(n)$$ -->\n\n# Code\n```\nclass Solution {\n    public ListNode mergeNodes(ListNode head) {\n        ListNode dummyNode = new ListNode(0);\n        ListNode newCur = dummyNode;\n        ListNode cur = head;\n\n        while (true) {\n            int sum = 0;\n            while (cur.next != null && cur.next.val != 0) {\n                cur = cur.next;\n                sum += cur.val;\n            }\n            newCur.next = new ListNode(sum);\n            newCur = newCur.next;\n            cur = cur.next;\n            if (cur.next == null) break;\n        }\n\n        return dummyNode.next;\n    }\n}\n```
['Java']