Two Pointers
6 animated solutionsTwo indices walk toward an answer — converging on sorted input, or moving in lockstep on fast/slow runners. Cuts O(n²) pairwise checks down to O(n). Every problem below plays as an animated walkthrough with solutions in Python, Java and C++. Companies that ask these most: Wix, Bloomberg, Amazon.