easy O(n) - java
\nclass Solution {\n    public ListNode mergeNodes(ListNode head)\n    {\n        ListNode curr =new ListNode()  ;\n        ListNode root = curr;\n        int s
```\nclass Solution {\n    public ListNode mergeNodes(ListNode head)\n    {\n        ListNode curr =new ListNode()  ;\n        ListNode root = curr;\n        int sum=0;\n        while (head !=null)\n        {\n            if(head.val ==0  && sum!= 0)\n            {\n                curr.val=sum;\n                if(head.next == null) break;;\n                curr.next= new ListNode();\n                curr=  curr.next;\n                sum=0;\n            }\n            sum +=head.val;  \n            head =head.next;\n            \n        }\n        return root ;\n    }\n}\n```
['Java']