⚡️ Tryprepforge
Coding Round 1 Mid-Level programming

**LeetCode #15 - 3Sum**\nGiven an array of integers, find all the unique triplets (a, b, c) such that a + b + c = 0, where a, b, and c are distinct indices in the array. You must return the result in a specific order of triplets.\n\n**Example 1:**\nInput: `[-1, 0, 1, 2, -1, -4]`\nOutput: `[[-1, -1, 2], [-1, 0, 1]]`\nExplanation: `-1 + -1 + 2 = 0` and `-1 + 0 + 1 = 0` are the two unique triplets.\n\n**Example 2:**\nInput: `[0, 1, 1]`\nOutput: `[]`\nExplanation: No triplet exists that sums to zero.\n\n**Constraints:**\n- 0 <= nums.length <= 3000\n- -10^5 <= nums[i] <= 10^5\n

Suggested Answer

Practice More Questions Like This

Generate unlimited interview questions with structured answers, code runner, and AI-powered walkthroughs.

No credit card required

More Coding Round 1 Interview Prep

Link copied to clipboard