Two pointers
Sliding windows, monotone invariants, and the linear-scan rule.
Setup
Two indices, one moving from each end. The invariant lives in the gap between them.
The invariant
Each step shrinks the window by one. The total work is linear.
Practice
Try the pattern on a sorted array and a target sum.