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