public int threeSumClosest(int[] num, int target) {
		Arrays.sort(num);
		int min = Integer.MAX_VALUE;
		// int[] minest = new int[num.length];
		// minest[0]=Integer.MAX_VALUE;minest[num.length-1]=Integer.MAX_VALUE;
		int min_target = 0;
		for (int i = 0; i < num.length; i++) {
			int left = i + 1, right = num.length - 1;

			while (left < right) {
				int result = num[i] + num[left] + num[right];
				int closest = result - target;
				// if target == result
				if (closest == 0) {
					// min = 0;
					return result;
				}
				// if result < target
				if (result < target) {

					left++;
				}
				// if result > target
				else {
					right--;
				}
				if (min > Math.abs(closest)) {
					min = Math.abs(closest);
					min_target = result;
				}

			}
		}
		return min_target;
	}