public int maxPoints(Point[] points) {
		if (points.length == 0) {
			return 0;
		}
		Map<Double, Integer> slopeNumMap = new HashMap<Double, Integer>();
		int result = 1;
		int duplicate = 0;
		int curMax = 1;
		for (int i = 0; i < points.length; i++) {
			curMax = 1;
			duplicate = 0;
			slopeNumMap.clear();
			for (int j = 0; j < points.length; j++) {
				if (i == j) {
					continue;
				}
				double slope = 0;
				if (points[i].x == points[j].x && points[i].y == points[j].y) {
					duplicate++;
				} else {
					if (points[i].x == points[j].x) {
						slope = Integer.MAX_VALUE;
					} else {
						slope = (double) (points[i].y - points[j].y)
								/ (double) (points[i].x - points[j].x);
					}

					if (slopeNumMap.containsKey(slope)) {
						slopeNumMap.put(slope, slopeNumMap.get(slope) + 1);
					} else {
						slopeNumMap.put(slope, 2);
					}
				}
			}
			for (double s : slopeNumMap.keySet()) {
				curMax = Math.max(curMax, slopeNumMap.get(s));
			}
			curMax += duplicate;
			result = Math.max(result, curMax);
		}

		return result;
	}