public static ArrayList<ArrayList<Integer>> threeSum2(int[] num) {
		Arrays.sort(num);
		ArrayList<ArrayList<Integer>> result = new ArrayList<ArrayList<Integer>>();
		for(int i = 0; i < num.length - 2;i++){
			if(i > 0 && num[i] == num[i-1])continue;
			int j = i + 1;
			int k = num.length - 1;
			while(j < k){
				int twoSum = num[i] + num[j];
				if(twoSum + num[k] > 0){
					k--;
				}else if(twoSum + num[k] < 0){
					j++;
				}else {
					addTuple(result,new int[]{num[i],num[j],num[k]});
					j++;
					k--;
					while(num[j] == num[j - 1] && num[k]==num[k+1] && j < k){
						j++;
						k--;
					}
				}
			}
		}
		return result;
	}