Beats 98.7% users effectively and easy to understand
\n\n# Code\n\nclass Solution:\n\n    def mergeNodes(self, head):\n\n        # Start with the first non-zero value.\n\n        head = head.next\n\n        if not
\n\n# Code\n```\nclass Solution:\n\n    def mergeNodes(self, head):\n\n        # Start with the first non-zero value.\n\n        head = head.next\n\n        if not head:\n\n            return head\n\n        # Initialize a dummy head node.\n\n        temp = head\n\n        sum = 0\n\n        while temp.val != 0:\n\n            sum += temp.val\n\n            temp = temp.next\n\n        # Store the sum in head\'s value.\n\n        head.val = sum\n\n        # Store head\'s next node as the recursive result for temp node.\n\n        head.next = self.mergeNodes(temp)\n\n        return head\n```
['Linked List', 'C', 'Simulation', 'Python', 'C++', 'Python3']