Easy Python solution|| Conversion of linked list to list
\n# Code\n\n# Definition for singly-linked list.\n# class ListNode(object):\n#     def __init__(self, val=0, next=None):\n#         self.val = val\n#         se
\n# Code\n```\n# Definition for singly-linked list.\n# class ListNode(object):\n#     def __init__(self, val=0, next=None):\n#         self.val = val\n#         self.next = next\nclass Solution(object):\n    def mergeNodes(self, head):\n        """\n        :type head: Optional[ListNode]\n        :rtype: Optional[ListNode]\n        """\n        lst=[]\n        sm=0\n        while head:\n            if head.val==0:\n                if sm>0:\n                    lst.append(sm)\n                sm=0\n            sm+=head.val\n            head=head.next\n        final_lst=ListNode(0)\n        tmp=final_lst\n        for i in lst:\n            tmp.next=ListNode(i)\n            tmp=tmp.next\n        return final_lst.next\n\n```
['Python']