15. 3Sum

public class Solution {
    public List> threeSum(int[] nums) {
        Arrays.sort(nums);
        List> res=new ArrayList<>();
        for(int i=0;i0&&nums[i]!=nums[i-1])){
                int lo=i+1,hi=nums.length-1,sum=0-nums[i];
                while(lo

你可能感兴趣的:(15. 3Sum)