Python3 || Explanation & Example
Idea: Given the integer a and integer b we first Traversal a node of list1 then save the pointer suppose in start. Then continue traversal to b node. We point s
**Idea:** Given the integer a and integer b we first Traversal a node of list1 then save the pointer suppose in `start`. Then continue traversal to b node. We point `start` to list2 and we traversal list2 to the end and point end of list2 to b.\n\n**Example:**\n```\nlist1 = [0,1,2,3,4,5], a = 3, b = 4, list2 = [1000000,1000001,1000002]\n \n(i) First do traversal of a node(3 node). so we travel 0->1->2.\n\tNow save the pointer in start. \n(ii) Continue Traversal of list to b node(4 node). \n\tso 0->1->2->3.\n(iii) Now point start to list2. \n\t so, 0->1->2->1000000->1000001->1000002.\n(iv) Now do travesal of list2. and map end of list2 to b, \n\t so, 0->1->2->1000000->1000001->1000002->5.\n```\n\n**Code:**\n```\nclass Solution:\n    def mergeInBetween(self, list1: ListNode, a: int, b: int, list2: ListNode) -> ListNode:\n        curr=list1\n        for count in range(b):\n            if count==a-1:      # travel to a node and   --> step 1\n                start=curr      # then save pointer in start\n            curr=curr.next   # continue travel to b node  --> step 2\n        start.next=list2     # point start to list2   --> step3\n        while list2.next:    # travel list2   --> step 4\n            list2=list2.next\n        list2.next=curr.next  # map end of list2 to b\n        return list1\n```\nUpvote if you find it helpful :)
['Python3']