From cf42d80efc34e549f73c91dd22f2fbdbcbd39778 Mon Sep 17 00:00:00 2001 From: QuinnDK <39618652+QuinnDK@users.noreply.github.com> Date: Thu, 13 May 2021 09:24:19 +0800 Subject: [PATCH] =?UTF-8?q?Update=200015.=E4=B8=89=E6=95=B0=E4=B9=8B?= =?UTF-8?q?=E5=92=8C.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- problems/0015.三数之和.md | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) diff --git a/problems/0015.三数之和.md b/problems/0015.三数之和.md index 55e22887..96dc1ac3 100644 --- a/problems/0015.三数之和.md +++ b/problems/0015.三数之和.md @@ -221,6 +221,40 @@ Python: Go: +```Go +func threeSum(nums []int)[][]int{ + sort.Ints(nums) + res:=[][]int{} + + for i:=0;i0{ + break + } + if i>0&&n1==nums[i-1]{ + continue + } + l,r:=i+1,len(nums)-1 + for l