Two Pointers

Sorted-array pair problems, fast/slow pointers, partitioning, merge-style and opposite-direction two-pointer techniques.

30 notes

Notes

Data Structures

4Sum

Find all unique quadruplets that sum to a target using sorting, nested loops, and two pointers, in O(n^3) time.

Read more