Simple implementation | TC O(b + m) & SC O(1)
Intuition\n Describe your first thoughts on how to solve this problem. \nsince we have to remove nodes from a to b. keep note of node just previous to ath node 
# Intuition\n<!-- Describe your first thoughts on how to solve this problem. -->\nsince we have to remove nodes from a to b. keep note of node just previous to ath node and node next to bth node. point l1_node_prev_to_ath\'s next to  head of list2 and next of last node of list2 to l1_node_next_to_bth\n# Complexity\n- Time complexity:\n<!-- Add your time complexity here, e.g. $$O(n)$$ -->\n$$O(b + m)$$ \nsince we are iterating on list1 till we get bth node and iterating on list2 till we get the last node.\n- Space complexity:\n<!-- Add your space complexity here, e.g. $$O(n)$$ -->\n$$O(1)$$\n# Code\n```\n/**\n * Definition for singly-linked list.\n * struct ListNode {\n *     int val;\n *     ListNode *next;\n *     ListNode() : val(0), next(nullptr) {}\n *     ListNode(int x) : val(x), next(nullptr) {}\n *     ListNode(int x, ListNode *next) : val(x), next(next) {}\n * };\n */\nclass Solution {\npublic:\n    ListNode* mergeInBetween(ListNode* list1, int a, int b, ListNode* list2) {\n        ListNode *l1_node_prev_to_ath, *l1_node_next_to_bth, *ptr;\n        ptr = list1;    // initializing ptr to head of list1\n        int cnt=0;\n        while(ptr!=NULL){\n            if(cnt == a-1){\n                l1_node_prev_to_ath = ptr;\n            }\n            else if(cnt == b){\n                l1_node_next_to_bth = ptr->next;\n                break;\n            }\n            \n            cnt++;\n            ptr = ptr->next;\n            \n        }\n\n        l1_node_prev_to_ath->next = list2;\n        ptr = list2;    // re-initializing ptr to head of list2\n        while(ptr->next!=NULL){\n            ptr=ptr->next;\n        }\n        ptr->next = l1_node_next_to_bth;\n        \n        return list1;\n    }\n};\n```
['Linked List', 'C++']