Skip to content

Commit a5924fc

Browse files
committed
Merge pull request halfrost#96 from yangzuwei/master
Update 15. 3Sum.go
2 parents bcf217f + ebbb735 commit a5924fc

File tree

2 files changed

+0
-6
lines changed

2 files changed

+0
-6
lines changed

leetcode/0015.3Sum/15. 3Sum.go

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,6 @@ import (
88
func threeSum(nums []int) [][]int {
99
sort.Ints(nums)
1010
result, start, end, index, addNum, length := make([][]int, 0), 0, 0, 0, 0, len(nums)
11-
if length > 0 && (nums[0] > 0 || nums[length-1] < 0) {
12-
return result
13-
}
1411
for index = 1; index < length-1; index++ {
1512
start, end = 0, length-1
1613
if index > 1 && nums[index] == nums[index-1] {

website/content/ChapterFour/0015.3Sum.md

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -46,9 +46,6 @@ import (
4646
func threeSum(nums []int) [][]int {
4747
sort.Ints(nums)
4848
result, start, end, index, addNum, length := make([][]int, 0), 0, 0, 0, 0, len(nums)
49-
if length > 0 && (nums[0] > 0 || nums[length-1] < 0) {
50-
return result
51-
}
5249
for index = 1; index < length-1; index++ {
5350
start, end = 0, length-1
5451
if index > 1 && nums[index] == nums[index-1] {

0 commit comments

Comments
 (0)