S
All challenges
Practice
Home
Blog
Practice
Examples
Feedback
Intersection of Two Linked Lists
00:00
Start
00:00
Sign in
Problem
Hints
3
Solution
History
Medium
Linked List
Two Pointers
HashSet
Amazon
Microsoft
Find the node at which two singly linked lists intersect. Return None if no intersection.
Examples
Example 1
Input →
A=4
Output →
1→8→4→5, B=5→6→1→8→4→5 → Node with val 8
Example 2
Input →
A=[2,6,4], B=[1,5]
Output →
None
Example 3
Input →
A=[1], B=[1] same node
Output →
Node 1
JavaScript
Python
Java (Coming soon)
C (Coming soon)
C++ (Coming soon)
Reset
Run
Submit
Cases
Results