[Python3] O(M+N) time O(1) space solution
M -> len(list1)\nN -> len(list2)\n\nclass Solution:\n    def mergeInBetween(self, list1: ListNode, a: int, b: int, list2: ListNode) -> ListNode:\n        list2_
M -> len(list1)\nN -> len(list2)\n```\nclass Solution:\n    def mergeInBetween(self, list1: ListNode, a: int, b: int, list2: ListNode) -> ListNode:\n        list2_head = list2_tail = list2\n        while list2_tail and list2_tail.next:\n            list2_tail = list2_tail.next\n            \n        list1_head = list1\n        for _ in range(a-1):\n            list1_head = list1_head.next\n            \n        nxt = list1_head.next\n        list1_head.next = list2_head\n        list1_head = nxt\n        \n        for _ in range(a, b):\n            list1_head = list1_head.next\n            \n        list2_tail.next = list1_head.next\n        list1_head.next = None # Not necessary and is just for the sake of completeness and detaching the middle\n        \n        return list1\n```
['Linked List', 'Python3']