Beats 70% using C++ | easy solution
Intuition\nFind tail of list 2, and link tail of list2 to node b + 1;\n\n\n\n# Complexity\n- Time complexity: O(n)\n\n- Space complexity: O(1)\n\n# Code\n\n/**\
# Intuition\nFind tail of list 2, and link tail of list2 to node b + 1;\n\n\n\n# Complexity\n- Time complexity: O(n)\n\n- Space complexity: O(1)\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        ListNode *tailOfList2 = NULL;\n        ListNode *cur1 = list1, *tmp = list1;\n        //find tail of list 2\n        for (ListNode *p = list2; p ; p = p -> next)\n            if (!p -> next) tailOfList2 = p;\n        //jump to a - 1\n        for (int i = 0; i < a - 1; i++)\n        {\n            cur1 = cur1 -> next;\n            tmp = tmp -> next;\n        }\n        tmp = tmp->next; // jump to a\n        //then jump to b + 1\n        for (int i = 0; i < b - a + 1; i++)\n            tmp = tmp -> next;\n        //link\n        tailOfList2 -> next = tmp;\n        cur1 -> next = list2;\n        return list1;\n    }\n};\n```
['C++']