Two Pointer Technique

The two pointer technique is a powerful pattern in competitive programming used to solve problems involving arrays or lists. It involves using two indices to traverse the data structure, often to find subarrays, pairs, or optimize time complexity.

Applications

Practice Problems

LeetCode
167. Two Sum II - Input array is sorted
Solution | Approach
LeetCode
283. Move Zeroes
Solution | Approach