Skip to content

Commit ebbb735

Browse files
author
yzw
authored
Update 15. 3Sum.go
unnecessary
1 parent bcf217f commit ebbb735

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

leetcode/0015.3Sum/15. 3Sum.go

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,7 @@ 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-
}
11+
1412
for index = 1; index < length-1; index++ {
1513
start, end = 0, length-1
1614
if index > 1 && nums[index] == nums[index-1] {

0 commit comments

Comments
 (0)