public int threeSumClosest(int[] num, int target) {
		Arrays.sort(num);
		int closest = target;
		int start = 0;
		int front = 1;
		int end = num.length - 1;
		int cal = 0;
		int result = 0;
		int diff = Integer.MAX_VALUE;
		while (front < end) {
			cal = closest - num[start];
			if (start > 0 && num[start] == num[start - 1]) {
				front = end;
			}
			while (front < end) {
				if (front > start + 1 && num[front] == num[front - 1]) {
					front++;
					continue;
				}
				if (Math.abs(cal - num[front] - num[end]) < diff) {
					diff = Math.abs(cal - num[front] - num[end]);
					result = num[start] + num[front] + num[end];
				}
				if (cal - num[front] - num[end] > 0) {
					front++;
				} else {
					end--;
				}
			}
			start = start + 1;
			front = start + 1;
			end = num.length - 1;
		}
		return result;
	}