[ Python ] ✅✅ Simple Python Solution | Nested Loop 🥳✌👍
If You like the Solution, Please UpVote! \uD83D\uDD3C\uD83D\uDE4F\n# Runtime: 6310 ms, faster than 29.52% of Python3 online submissions for Merge Nodes in Betwe
# If You like the Solution, Please UpVote! \uD83D\uDD3C\uD83D\uDE4F\n# Runtime: 6310 ms, faster than 29.52% of Python3 online submissions for Merge Nodes in Between Zeros.\n# Memory Usage: 104.3 MB, less than 16.40% of Python3 online submissions for Merge Nodes in Between Zeros.\n\n\tclass Solution:\n\t\tdef mergeNodes(self, head: Optional[ListNode]) -> Optional[ListNode]:\n\n\t\t\tcurrent_node = head.next\n\n\t\t\tresult = new_node = ListNode(0)\n\n\t\t\twhile current_node:\n\n\t\t\t\tcurrent_sum = 0\n\n\t\t\t\twhile current_node.val != 0:\n\t\t\t\t\tcurrent_sum = current_sum + current_node.val\n\t\t\t\t\tcurrent_node = current_node.next\n\n\t\t\t\tnew_node.next = ListNode(current_sum)\n\t\t\t\tnew_node = new_node.next\n\n\t\t\t\tcurrent_node = current_node.next\n\n\t\t\treturn result.next\n\n# Thank You \uD83E\uDD73\u270C\uD83D\uDC4D\n
['Linked List', 'Python', 'Python3']