Skip to content

Commit 6a5a868

Browse files
authored
Merge pull request #1 from kartiktom/kartiktom-patch-1
Create 3sum.txt
2 parents bf14e85 + bc5a038 commit 6a5a868

File tree

1 file changed

+22
-0
lines changed

1 file changed

+22
-0
lines changed

Array/leetcode 3sum/3sum.txt

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
Given an array nums of n integers, are there elements a, b, c in nums such that a + b + c = 0? Find all unique triplets in the array which gives the sum of zero.
2+
3+
Notice that the solution set must not contain duplicate triplets.
4+
5+
Example 1:
6+
7+
Input: nums = [-1,0,1,2,-1,-4]
8+
Output: [[-1,-1,2],[-1,0,1]]
9+
Example 2:
10+
11+
Input: nums = []
12+
Output: []
13+
Example 3:
14+
15+
Input: nums = [0]
16+
Output: []
17+
18+
19+
Constraints:
20+
21+
0 <= nums.length <= 3000
22+
-105 <= nums[i] <= 105

0 commit comments

Comments
 (0)