Algorithm · Expedia · Medium
Problem You are given two singly linked lists, list1 and list2, and two integers a and b satisfying 0 <= a <= b < length of list1. Your task is to remove the nodes from index a to index b (inclusive) from list1, then insert the entire list2 in their place. Return the head of the resulting linked list. Indices are zero-based, and the range [a, b] is inclusive. Input Format For evaluation purposes, linked lists are provided as arrays in the following format: Output Format…
Checking your access…