Skip to main content
HS
HiSETSuccess
LeetCode Prep

Algorithm Visualizer

Step through two pointers, sliding window, binary search, BFS/DFS, heaps, DP, and union-find one operation at a time.

← All visualizers

Two Pointers: Pair Sum

Walk inward from both ends of a sorted array, discarding a whole row of pairs with every move.

O(n) time · O(1) space

Up to 12 whole numbers in ascending order, then | and the target sum.

Presets
L
1
0
3
1
4
2
6
3
8
4
R
11
5

1/11Start with L at the smallest value (1) and R at the largest (11). Target is 10.

Keyboard: ← → step · Space play/pause