[Python O(N)] Accumulate at 0 nodes. One pointer.
Intuition\n Describe your first thoughts on how to solve this problem. \n1. Starting at 0 node add the value of the next node to the current and substitute next
# Intuition\n<!-- Describe your first thoughts on how to solve this problem. -->\n1. Starting at 0 node add the value of the next node to the current and substitute next with next.next.\n\n2. Do this until next is 0. Transfer to next 0 at this point. (According to the description - there will be no consecutive zeros. So no need to worry about edge cases)\n\n3. Remove last zero \n\n# Complexity\n- Time complexity: O(N)\n<!-- Add your time complexity here, e.g. $$O(n)$$ -->\n\n- Space complexity: O(1)\n<!-- Add your space complexity here, e.g. $$O(n)$$ -->\n\n# Code\n```\n# Definition for singly-linked list.\n# class ListNode:\n#     def __init__(self, val=0, next=None):\n#         self.val = val\n#         self.next = next\nclass Solution:\n    def mergeNodes(self, head: Optional[ListNode]) -> Optional[ListNode]:\n        \n        cur = head\n        while True:\n            if cur.next.val == 0 and cur.next.next == None:\n                cur.next = None\n                break\n\n            if cur.next.val == 0:\n                cur = cur.next\n            \n            cur.val += cur.next.val\n            cur.next = cur.next.next\n\n        return head\n```
['Python3']