c++ - Short Concise -Simple Readable - 15 lines - Explanation - Interview - O(N)
\n/*\n\nc++ - Short Concise -Simple Readable - Beginner - 15 lines - explanation - Interview - O(N)\n\nCreate a listNode pointer, move it till a, then insert li
```\n/*\n\nc++ - Short Concise -Simple Readable - Beginner - 15 lines - explanation - Interview - O(N)\n\nCreate a listNode pointer, move it till a, then insert list2 there, then move till the end of list 2. Similarly the same pointer after skipping b-a+1 nodes. Then attach the tail of current list2 there.\n\nThen return the head of list1\n\nBeats 100% Space\n\n*/\n\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 p1=0;\n        ListNode*curr1=list1,*curr2=list1;\n        while(p1<a-1 && curr1){\n            p1+=1;\n            curr1=curr1->next;\n            curr2=curr2->next;\n        }\n        while(p1<b+1){\n            p1+=1;\n            curr2=curr2->next;\n        }\n        curr1->next=list2;\n        while(curr1->next){\n            curr1=curr1->next;\n        }\n        curr1->next=curr2;\n        return list1;\n    }\n};\n```
[]