15% off all plans & roadmaps Use code
See plansLeetCode 599 · Solution & editorial
Suppose Andy and Doris want to choose a restaurant for dinner, and they both have a list of favorite restaurants represented by strings.
Minimum Index Sum of Two Lists is a Linked List Manipulation Patterns problem, in the Intersection Detection subpattern. The pattern covers in-place reversal, merging sorted lists, reordering, and intersection detection
Learn to find the intersection point of two linked lists using the two-pointer technique.
The reference solution runs in O((m + n)) time and O(m * l) space.
Minimum Index Sum of Two Lists has been reported in interviews at Oracle, Yelp.
The full editorial is part of Pro
It explains the core insight, the complexity analysis and the common mistakes, with a worked solution.
Minimum Index Sum of Two Lists is a Linked List Manipulation Patterns problem, in the Intersection Detection subpattern. Once the approach above makes sense, write it yourself and then work through the neighbouring problems that reuse it.