Adaptive pick · Two pointers
Two pointers
Two indices walk the array — often one from each end, or one fast + one slow. Perfect for pair-sum, in-place dedupe, and partitioning problems.
Teach
To reverse a string with two pointers, start one index at each end and swap the characters, then step both inward until they meet (i++, j--). O(n) time, O(1) extra space — the same converging-pointer pattern behind pair-sum on a sorted array and in-place partitioning.