Intersection of Two Linked Lists ​
Intersection of Two Linked Lists
Find the point at which two linked lists intersect
Approach ​
- Keep two pointers for each list.
- When pointer A completes list A, it traverses list B.
- When pointer B completes list B, it traverses list A.
- They both will meet at intersection, or will complete 2 traversals and meet at null.
Remarks ​
- I don't see the intuition
- https://www.youtube.com/watch?v=D0X0BONOQhI
- Code is very simple, and the switch happens only once for each pointer.