> For the complete documentation index, see [llms.txt](https://mabuxi.gitbook.io/mabuxi/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://mabuxi.gitbook.io/mabuxi/leetcode-summary/linkedlist/intersection.md).

# Intersection

## 经典题目&#x20;

[*160 Intersection of Two Linked Lists*](https://leetcode.com/problems/intersection-of-two-linked-lists/description/)

```java
public class Solution {
    public ListNode getIntersectionNode(ListNode one, ListNode two) {
        if (one == null || two == null) return null;
        
        ListNode i = one;
        ListNode j = two;

        while(i != j) {
            i = i == null ? two : i.next;
            j = j == null ? one : j.next;
        }

        return i;
    }
}
```
