š« Two Pointers
The "Bridge Crossing" Chapter
Two people walking toward each other on a bridge! Or one at start, one at end moving inward. Super efficient for sorted arrays!
Easy
ā
Valid Palindrome
Is it the same forwards and backwards?
Medium
ā
3Sum
Find all triplets that sum to zero!
Medium
ā
Container With Most Water
Max water between two lines!
šÆ Brain Hack
Pointers at opposite ends! For sorted arrays, start left and right, move toward center. Eliminates O(n²) to O(n)! Perfect for "two sum in sorted array"!