- It's a way to use two points to iterate [[Array]] or [[Linked List]] - Two pointers move in the same or opposite direction until one or both meet a condition. ## Two Pointers towards each other ### Senario - [[141. Linked List Cycle]] - [[876. Middle of the Linked List]] ### Grammar initialize pointers ```python left = 0, right = len (nums) - 1 ``` ## Fast and Slow Pointers initialize pointers ```python slow = fast = head ``` ## Sliding Window ```python left = 0, right = 0 ``` - senario - Usually, the array or list is sorted, and you need to find combinations (pair, triple, or subarray) that meet some condition. - remove the duplicates [**in-place**](https://en.wikipedia.org/wiki/In-place_algorithm)