⚡️ Tryprepforge
Coding Round 1 Mid-Level programming

**LeetCode #15 - 3Sum**\nGiven an integer array nums, return all the triplets [nums[i], nums[j], nums[k]] such that i != j, i != k, and j != k, and nums[i] + nums[j] + nums[k] == 0. Note that the solution set must not contain duplicate triplets.\n\n**Function Signature:** `def threeSum(nums: List[int]) -> List[List[int]]:`\n\n**Example 1:**\nInput: nums = [-1,0,1,2,-1,-4]\nOutput: [[-1,-1,2],[-1,0,1]]\nExplanation: The distinct triplets that sum up to zero are [-1,-1,2] and [-1,0,1].\n\n**Example 2:**\nInput: nums = []\nOutput: []\nExplanation: There are no triplets that satisfy the condition.\n\n**Constraints:**\n- 0 <= nums.length <= 3000\n- -10^5 <= nums[i] <= 10^5

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