[Python 3] - 2 pointers approach code with comments - O(m+n)
This is my approach to the problem using 2 pointers :\n\nclass Solution:\n    def mergeInBetween(self, list1: ListNode, a: int, b: int, list2: ListNode) -> List
This is my approach to the problem using 2 pointers :\n```\nclass Solution:\n    def mergeInBetween(self, list1: ListNode, a: int, b: int, list2: ListNode) -> ListNode:\n        # Define 2 pointers\n\t\tptr1 = list1\n        ptr2 = list1\n        i, j = 0, 0\n\t\t\n\t\t# Loop for pointer 1 to reach previous node from a\n        while i!=a-1:\n            ptr1 = ptr1.next\n            i += 1 \n\t\t\t\n\t\t# Loop for pointer 2 to reach node b\n        while j!=b:\n            ptr2 = ptr2.next\n            j += 1\n\t\t\t\n\t\t# Connect list2 to the next of pointer1\n        ptr1.next = list2\n\t\t\n\t\t# Traverse the list2 till end node\n        while list2.next!=None:\n            list2 = list2.next\n\t\t\n\t\t# Assign the next of pointer 2 to the next of list2 i.e connect the remaining part of list1 to list2\n        list2.next = ptr2.next\n\t\t\n\t\t# return final list\n        return list1\n```\n\nFeel free to comment down your solutions as well :)
['Linked List', 'Python3']