Simple solution in C || Basic approach || using two loops ||  Two Flags Solutpoion
Intuition\n Describe your first thoughts on how to solve this problem. \nSimple solution in c. it is a basic approach to solve this problem. \n\n# Approach\n De
# Intuition\n<!-- Describe your first thoughts on how to solve this problem. -->\nSimple solution in c. it is a basic approach to solve this problem. \n\n# Approach\n<!-- Describe your approach to solving the problem. -->\nFor this problem there are three stages:\nstage 1: Traverse the list1 and point a-1 as flag1 and b as flag2 nodes\nstage 2: Now add list 2 to the **flag1->next(a-1)** \nstage 3: Now Traverse to list2 end and add **list2 end->next to flag2** \nnow return the list1.....\n\n# Complexity\n- Time complexity: O(n**2)\n<!-- Add your time complexity here, e.g. $$O(n)$$ -->\n\n- Space complexity:O(n)\n<!-- Add your space complexity here, e.g. $$O(n)$$ -->\n\n# Code\n```\n/**\n * Definition for singly-linked list.\n * struct ListNode {\n *     int val;\n *     struct ListNode *next;\n * };\n */\n\n\nstruct ListNode* mergeInBetween(struct ListNode* list1, int a, int b, struct ListNode* list2){\n        // if(list1==NULL)\n        // {\n        //     return list2;\n        // }\n        // return NULL\n        int c=0;\n        struct ListNode * temp=list1;\n        struct ListNode * t1=NULL,*t2=NULL;\n        while(temp)\n        {\n            \n            if(c==a-1)\n            {\n                t1=temp;\n            }\n            temp=temp->next;\n            c++;\n            if (c==b)\n            {\n                t2=temp;\n                break;\n            }\n        }\n        t1->next=list2;\n        temp=list2;\n    while(temp->next)\n        {\n            temp=temp->next;\n        }\n        temp->next=t2->next;\n        return list1;\n}\n```
['Linked List', 'Two Pointers', 'C', 'Counting', 'C++']