🗓️ Daily LeetCoding Challenge Day 3|| 🔥 JAVA SOL
I hope a good day for u!\n\n# Code\n\nclass Solution {\n    public ListNode mergeInBetween(ListNode list1, int a, int b, ListNode list2) {\n        ListNode cur
I hope a good day for u!\n\n# Code\n```\nclass Solution {\n    public ListNode mergeInBetween(ListNode list1, int a, int b, ListNode list2) {\n        ListNode currNode = list1; // Start of the first list\n        int index = 0; // Variable to track current position\n        // Move to the element before index "a"\n        while (index < a - 1) {\n            currNode = currNode.next;\n            index++;\n        }\n        ListNode front = currNode; // Store current position as "front"\n        // Move to the element after index "b"\n        while (index < b + 1) {\n            currNode = currNode.next;\n            index++;\n        }\n        ListNode rear = currNode; // Store current position as "rear"\n        ListNode secondListTail = list2, secondListHead = list2;\n        // Finding the tail of the second list\n        while (secondListTail.next != null) {\n            secondListTail = secondListTail.next;\n        }\n        // Link the front part of the second list after "front"\n        front.next = secondListHead;\n        // Link the rear part of the second list before "rear"\n        secondListTail.next = rear;\n        return list1; // Return the updated list\n    }\n}\n\n```
['Java']