Two pointers uses two index positions moving through an array based on conditions. You use it when the input is sorted or when you need to find pairs/triplets with a target property.
The core insight: by moving pointers strategically, you avoid checking all pairs. One pointer at each end, moving inward based on comparison results. If sum is too small, move left pointer right (increase sum). If too large, move right pointer left (decrease sum).
This reduces brute force to for many problems.