Algorithm · Oracle · Medium
Suppose you are given two non-empty singly linked lists, list1 and list2, as well as two zero-based indices i and j where $$0 \le i \le j$$. Remove from list1 the contiguous run of nodes starting at index i and ending at index j inclusive. In that same location, insert all nodes of list2 in their original order. The prefix of list1 before index i and the suffix after index j keep their relative order; the tail of list2 is linked to the node immediately after the deleted span…
Checking your access…