Merge pull request #96 from yangzuwei/master

Update 15. 3Sum.go
This commit is contained in:
halfrost
2021-01-30 12:32:47 +08:00
committed by YDZ
2 changed files with 0 additions and 6 deletions

View File

@ -8,9 +8,6 @@ import (
func threeSum(nums []int) [][]int {
sort.Ints(nums)
result, start, end, index, addNum, length := make([][]int, 0), 0, 0, 0, 0, len(nums)
if length > 0 && (nums[0] > 0 || nums[length-1] < 0) {
return result
}
for index = 1; index < length-1; index++ {
start, end = 0, length-1
if index > 1 && nums[index] == nums[index-1] {