Two Pointer Technique: Solving Pair and Partition Problems in O(n)
5d ago · 19 min read · TLDR: Place one pointer at the start and one at the end of a sorted array. Move them toward each other based on a comparison condition. Every classic pair/partition problem that naively runs in O(n²)
Join discussion
















