Two Pointers/Medium
3SumPRO PASS
Time: O(N^2)Space: O(1)
Initialize Two Pointers
Array is sorted. Set left pointer L=0 (val -4) and right pointer R=5 (val 2).
Array Elements & Pointers
L
-4
L-1
[1]-1
[2]0
[3]1
[4]R
2
RLive Variables & Invariants
target:0
left:0
right:5
sum:-2
Step 1 / 714%
Solution Code
Custom Test Case Runner
Input your custom values and visualize step-by-step trace
Quick Presets:
AI DSA Coach
Contextual Tutor for 3Sum
Hello! I am your AI DSA Tutor for **3Sum** (Two Pointers). Ask me anything about this algorithm, time complexity, or request a step hint!