Arrays and Two Pointers • Intermediate • 25 min
3Sum
How to reduce a three-variable problem into [two pointers](/glossary/two-pointers) after sorting and handling duplicates in a controlled way.
Practice problems with walkthroughs, hints, and solutions.
Filter by type or level
Arrays and Two Pointers • Intermediate • 25 min
How to reduce a three-variable problem into [two pointers](/glossary/two-pointers) after sorting and handling duplicates in a controlled way.
Arrays and Two Pointers • Intermediate • 18 min
How to justify why only the shorter side makes sense to move and use that to shrink the search.
Arrays and Two Pointers • Advanced • 28 min
How to notice that water at each position depends on both side maximums and compress that into [two pointers](/glossary/two-pointers).