daily leetcode - 3sum - !
题目地址 https://leetcode.com/problems/3sum/ 题目描述 Given an array S of n integers, are there elements a , b , c in S such that a + b + c = 0? Find all unique triplets in the array which gives the sum of zero. Note: Elements in a triplet ( a , b , c ) must be in non-descending order. (ie, a ≤ b ≤ c ) The solution set must not contain duplicate triplets. For example, given array S = {-1 0 1 2 -1 -4}, A solution set is: (-1, 0, 1) (-1, -1, 2) 思路 这道题让我们求三数之和,比之前那道 Two Sum 要复杂一些,博主考虑过先 fix 一个数,然后另外两个数....