✅✅ Beginner's Friendly || Easy Approach || JAVA || 1s || Beats 100%🔥🔥
Intuition\n Describe your first thoughts on how to solve this problem. \nJust points the required points to new points\n\n# Approach\n Describe your approach to
# Intuition\n<!-- Describe your first thoughts on how to solve this problem. -->\nJust points the required points to new points\n\n# Approach\n<!-- Describe your approach to solving the problem. -->\n\n# Complexity\n- Time complexity:\n<!-- Add your time complexity here, e.g. $$O(n)$$ -->\n\n- Space complexity:\n<!-- Add your space complexity here, e.g. $$O(n)$$ -->\n\n# Code\n```\n/**\n * Definition for singly-linked list.\n * public class ListNode {\n *     int val;\n *     ListNode next;\n *     ListNode() {}\n *     ListNode(int val) { this.val = val; }\n *     ListNode(int val, ListNode next) { this.val = val; this.next = next; }\n * }\n */\nclass Solution {\n    public ListNode mergeInBetween(ListNode list1, int a, int b, ListNode list2) {\n        ListNode temp = list1;\n        for(int i = 0 ; i < b ; i++){\n            temp = temp.next;\n        }\n        ListNode temp2 = list2;\n        while(temp2.next!=null){\n            temp2 = temp2.next;\n        }\n        temp2.next = temp.next;\n\n        ListNode temp3 = list1;\n        for(int i = 0 ; i < a-1 ; i++){\n            temp3 = temp3.next;\n        }\n        temp3.next = list2;\n        return list1;\n    }\n}\n```
['Java']