[Java] Straightforward solution in O(N) time
\nclass Solution {\n    public ListNode mergeInBetween(ListNode list1, int a, int b, ListNode list2) {\n        ListNode start = list1;\n        for (int i = 1;
```\nclass Solution {\n    public ListNode mergeInBetween(ListNode list1, int a, int b, ListNode list2) {\n        ListNode start = list1;\n        for (int i = 1; i < a; i++) {\n            start = start.next;\n        }\n        \n        ListNode end = start;\n        for (int i = a; i <= b; i++) {\n            end = end.next;\n        }\n        \n        start.next = list2;\n        while (list2.next != null) {\n            list2 = list2.next;\n        }\n        \n        list2.next = end.next;\n        return list1;\n    }\n}\n```
[]