easy code in c++
\n\n# Code\n\n/**\n * Definition for singly-linked list.\n * struct ListNode {\n *     int val;\n *     ListNode *next;\n *     ListNode() : val(0), next(nullpt
\n\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        int count=0;\n        ListNode* start=nullptr;\n        ListNode* tail=nullptr;\n        ListNode* result=list1;\n        while(count<=b) {\n            if(count==a-1) {\n                start=list1;\n            }\n            if(count==b) {\n                tail=list1->next;\n            }\n            count++;\n            list1=list1->next;\n        }\n        ListNode*ptr=list2;\n        while(ptr->next != nullptr) {\n            ptr=ptr->next;\n        }\n        ptr->next=tail;\n        start->next=list2;\n        return result;\n    }\n};\n```
['C++']