# Leetcode Interview - Intersection of Two Linked Lists LCCI

Note:

• Pattern: When using 2-pointer, let one pointer moves first can have some surprising results.
• Get the lengths of two linked lists.
• Create two pointers, let the pointer pointing to the longest list moves diff steps (Diff = | lengthA - lengthB |).
• When pointerA === pointerB, we got the result!

Question:

Given two (singly) linked lists, determine if the two lists intersect. Return the inter­ secting node. Note that the intersection is defined based on reference, not value. That is, if the kth node of the first linked list is the exact same node (by reference) as the jth node of the second linked list, then they are intersecting.

Example:

Code: