@@ -0,0 +1,1545 @@
+/**%0A * Definition for a point.%0A * class Point %7B%0A *     int x;%0A *     int y;%0A *     Point() %7B x = 0; y = 0; %7D%0A *     Point(int a, int b) %7B x = a; y = b; %7D%0A * %7D%0A */%0A%0Apublic class Solution %7B%0A    /**%0A     * @param points: an array of point%0A     * @return: An integer%0A     */%0A    public int maxPoints(Point%5B%5D points) %7B%0A        // Write your code here%0A        if(points == null %7C%7C points.length == 0)%7B%0A            return 0;%0A        %7D%0A        int result = 1;%0A        HashMap%3CDouble , Integer%3E record = new HashMap%3CDouble , Integer%3E();%0A        for(int i = 0; i%3Cpoints.length;i++)%7B%0A            int same = 0;%0A            record.clear();%0A            record.put((double)Integer.MIN_VALUE , 1);%0A            for(int j = i+1;j%3Cpoints.length;j++)%7B%0A                if(points%5Bj%5D.x == points%5Bi%5D.x && points%5Bj%5D.y == points%5Bi%5D.y)%7B%0A                    same++;%0A                    continue;%0A                %7D%0A                double k = 0;%0A                if(points%5Bj%5D == points%5Bi%5D)%7B%0A                    k = (double)Integer.MAX_VALUE;%0A                %7Delse%7B%0A                    k = (double)(points%5Bj%5D.y - points%5Bi%5D.y)/(double)(points%5Bj%5D.x - points%5Bi%5D.x);%0A                %7D%0A                if(record.containsKey(k))%7B%0A                    record.put(k , record.get(k) + 1);%0A                %7Delse%7B%0A                    record.put(k , 2);%0A                %7D%0A            %7D%0A            for(int count : record.values())%7B%0A                if(count + same %3E result)%7B%0A                    result = count + same;%0A                %7D%0A            %7D%0A        %7D%0A        return result;%0A    %7D%0A%7D

add 186