0016. 3Sum Closest
Find three integers in the array whose sum is closest to the target
Sort + Two Pointers (Optimal)
Brute Force
Array:
Target:
Apply
Random
◀ Prev
▶ Play
Next ▶
Reset
Speed:
5x
Target
1
Current Sum
—
Best Sum
—
Distance
—
Step
0 / 0
Sorting phase: original array is being sorted for two-pointer approach
Best dist:
0
Curr dist:
0
i (fixed)
left
right
default
i
j
k
default