3Sum

Medium

📝 Description

Find all unique triplets that sum to 0

Input Format

Array of integers

Output Format

List of triplets

Constraints

0 ≤ nums.length ≤ 3000

🔍 Sample Input

[-1,0,1,2,-1,-4]
            

✅ Sample Output

[[-1,-1,2],[-1,0,1]]
            

Code Editor

Please login to run and submit code.

Shortcuts: Ctrl+Enter to submit, Ctrl+Shift+R to run