#12 Medium Time O(n²) Space O(n) Animated

3Sum

Find all unique triplets in the array which gives the sum of zero.

LeetCode ↗
Approach: Sort and Two Pointers
Click play to start
Step 0 / 0
Press play to start the visualization.

Steps