@@ -0,0 +1,1442 @@
+/**%0A * Problem Link: https://leetcode.com/problems/max-points-on-a-line/%0A * %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 */%0Apublic class Solution %7B%0A    public int maxPoints(Point%5B%5D points) %7B%0A        int max = 0;%0A        for(int i=0; i%3Cpoints.length; i++) %7B%0A            int duplicate = 1;%0A            int verticle = 0;%0A            HashMap%3CDouble, Integer%3E map = new HashMap%3CDouble, Integer%3E();%0A            for(int j=i+1; j%3Cpoints.length; j++) %7B%0A                if(points%5Bi%5D.x == points%5Bj%5D.x) %7B%0A                    if(points%5Bi%5D.y == points%5Bj%5D.y) duplicate ++;%0A                    else verticle ++;%0A                    max = Math.max(max, duplicate + verticle);%0A                %7D else %7B%0A                    double slope = points%5Bi%5D.y == points%5Bj%5D.y ? 0.0 : 1.0 * (points%5Bj%5D.y - points%5Bi%5D.y) / (points%5Bj%5D.x - points%5Bi%5D.x);%0A                    if(map.get(slope) == null) %7B%0A                        map.put(slope, 1);%0A                    %7D else %7B%0A                        map.put(slope, map.get(slope) + 1);%0A                    %7D%0A                    max = Math.max(max, duplicate + map.get(slope));%0A                %7D%0A            %7D%0A            max = Math.max(max, duplicate + verticle);%0A            for(Integer cnt : map.values())%7B%0A                max = Math.max(max, duplicate + cnt);%0A            %7D %0A        %7D%0A        return max;%0A    %7D%0A%7D%0A

Create Max_Points_on_a_Line.java