@@ -0,0 +1,1082 @@
+package leetcode;%0A%0Aimport java.util.ArrayList;%0Aimport java.util.Arrays;%0Aimport java.util.HashSet;%0Aimport java.util.List;%0Aimport java.util.Set;%0A%0Apublic class Problem15 %7B%0A    public List%3CList%3CInteger%3E%3E threeSum(int%5B%5D num) %7B%0A        Arrays.sort(num);%0A        List%3CList%3CInteger%3E%3E result = new ArrayList%3C%3E();%0A        Set%3CList%3CInteger%3E%3E set = new HashSet%3C%3E();%0A        for (int i = 0; i %3C num.length; i++) %7B%0A            for (int j = 0; j %3C num.length; j++) %7B%0A                if (i %3E= j) %7B%0A                    continue;%0A                %7D%0A                int val = -(num%5Bi%5D + num%5Bj%5D);%0A                int k = Arrays.binarySearch(num, j+1, num.length, val);%0A                if (k %3C 0 %7C%7C j %3E= k) %7B%0A                    continue;%0A                %7D%0A                List%3CInteger%3E list = new ArrayList%3C%3E();%0A                list.add(num%5Bi%5D);%0A                list.add(num%5Bj%5D);%0A                list.add(num%5Bk%5D);%0A                if (!set.contains(list)) %7B%0A                    set.add(list);%0A                    result.add(list);%0A                %7D%0A            %7D%0A        %7D%0A        return result;%0A    %7D%0A%7D%0A

Solve problem 15