#链表
```cpp
class Solution
{
public:
ListNode* mergeInBetween(ListNode* list1, int a, int b, ListNode* list2)
{
auto t_list1 = list1;
for (int i = 0; i < a - 1; ++i)
{
t_list1 = t_list1->next;
}
auto to_be_free = t_list1->next;
for (int i = 0; i <= b - a; ++i)
{
auto t = to_be_free->next;
delete to_be_free;
to_be_free = t;
}
t_list1->next = list2;
while (t_list1->next)t_list1 = t_list1->next;
t_list1->next = to_be_free;
return list1;
}
};
```