merge nodes in between zeros
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\n- Space complexity:\n<!-- Add your space complexity here, e.g. $$O(n)$$ -->\n\n# Code\n```\n/**\n * Definition for singly-linked list.\n * public class ListNode {\n *     int val;\n *     ListNode next;\n *     ListNode() {}\n *     ListNode(int val) { this.val = val; }\n *     ListNode(int val, ListNode next) { this.val = val; this.next = next; }\n * }\n */\nclass Solution {\n    public ListNode mergeNodes(ListNode head) {\n       if(head.val==0){\n        head=head.next;\n        \n       }ListNode temp=head;\n        ListNode res=head;\n        \n        int sum=0; \n        while(temp!=null){\n           \n            if(temp.val==0){\n                res.next=temp.next;\n                res.val=sum;\n                temp=temp.next;\n                sum=0;\n                res=temp;\n            }\n            else{\n                sum+=temp.val;\n                temp=temp.next;\n            }\n        }\n        return head;\n    }\n}\n```
['Java']