Skip to main content
🔒 Preview mode. The first 15 Foundations lessons are free; this one is Pro. Start a 7-day trial to unlock the editor, AI hints and the rest of the curriculum. Card required, cancel any time in Dashboard.Start 7-day trial →
← CoursesInterview PrepModule 2 · Arrays, Strings, Two-PointerThree pointers: 3Sumwrite18 / 104
+125 XP
Task
📝 **Task:** Write `three_sum(nums)` returning all unique triplets summing to 0. Print `three_sum([-1, 0, 1, 2, -1, -4])`. Expected: [[-1, -1, 2], [-1, 0, 1]] 📋 Implement the function above. Tests run automatically. 💡 **Hint:** Re-read the theory if stuck.
✏️ Write your code here
🐍
Loading Python...
One-time download (~1 MB). Then it runs instantly.
📊 Result
Press Run to see result...

💬 Discussion

Be the first to ask a question or share a tip.
Sign in to join the discussion. Reading is free.
Loading discussion…