public ArrayList<ArrayList<Integer>> threeSum(int[] num) {
            Arrays.sort(num);
            ArrayList<ArrayList<Integer>> ans = new ArrayList<ArrayList<Integer>>();
            for (int i = 0; i < num.length - 2; i++) {
                if (i > 0 && num[i] == num[i - 1]) {
                    continue;
                }
                twoSum(ans, num[i], num, i + 1);
            }
            return ans;
        }