Back to Dashboard
PATTERN

Two Pointers

Use two pointers to traverse a sorted array or string from both ends (or at different speeds) to solve problems in O(n) time with O(1) space.

0 of 5 solved
O(n)
Learn Two PointersExplanation, templates & reference