Best Approach💯
Intuition\n Describe your first thoughts on how to solve this problem. \n\n# Approach\n Describe your approach to solving the problem. \n\n# Complexity\n- Time 
# Intuition\n<!-- Describe your first thoughts on how to solve this problem. -->\n\n# Approach\n<!-- Describe your approach to solving the problem. -->\n\n# Complexity\n- Time complexity:\nO(n+m)\n\n- Space complexity:\nO(1)\n\n# Code\n```\n/**\n * Definition for singly-linked list.\n * function ListNode(val, next) {\n *     this.val = (val===undefined ? 0 : val)\n *     this.next = (next===undefined ? null : next)\n * }\n */\n/**\n * @param {ListNode} list1\n * @param {number} a\n * @param {number} b\n * @param {ListNode} list2\n * @return {ListNode}\n */\nvar mergeInBetween = function(list1, a, b, list2) {\n    let cur=list1,pivot=null,pos=0\n   while(cur.next){\n    if(pos==a-1){\n        pivot=cur.next\n        cur.next=list2\n    }\n    pos++\n    cur=cur.next\n   }\n   for(let i=a;i<b+1;i++){\n    pivot=pivot.next\n   }\n\n    cur.next=pivot\n\n\n    return list1\n};\n```
['JavaScript']