Two Pointers & Sliding Window
Two Pointers is a technique where we maintain two indices (often l and r) that move over the array or string.
Sliding Window is a special case applied to contiguous subarrays: we expand with one pointer, and contract with the other, depending on constraints.
This transforms many naive solutions into or with proper data structures.
Resources
- CSES Book — Chapter 8: Two Pointers
- Incarnadine Training Units — Problems PDF
- USACO Guide — Silver: Two Pointers
- USACO Guide — Gold: Sliding Window
- GeeksforGeeks — Two Pointers Technique

