Easy to Understand C++ O(n)
# Intuition\n\n Describe your first thoughts on how to solve this problem. \n\n\n\n# Code\n\nclass Solution {\npublic:\n    ListNode* mergeInBetween(ListNode* l
[]()# Intuition\n![Screenshot (31).png](https://assets.leetcode.com/users/images/d866129c-ba2a-4107-a4d8-9fa805a55c82_1710950519.2430296.png)\n<!-- Describe your first thoughts on how to solve this problem. -->\n\n\n\n# Code\n```\nclass Solution {\npublic:\n    ListNode* mergeInBetween(ListNode* list1, int a, int b, ListNode* list2) {\n        ListNode *p1=list1,*p2=list1,*p3=list2;\n        for(int i=0;i<a-1;i++) p1=p1->next;\n        for(int i=0;i<=b;i++)p2=p2->next;\n        while(p3->next!=NULL)p3=p3->next;\n        p1->next=list2;\n        p3->next=p2;\n        return list1;\n    }\n};\n```
['C++']