* Definition for a point. * class Point { * int x; * int y; * Point() { x = 0; y = 0; } * Point(int a, int b) { x = a; y = b; } * } */ publicclass{ publicintmaxPoints(Point[] points){ if(points.length <= 2) return points.length;
int result = 0;
for(int i = 0; i < points.length; i++){ //key为斜率,value为点数 HashMap<Double, Integer> map = new HashMap<>(); //x坐标相等的点的数量 int samex = 1; //记录相同点 int samep = 0;
近期评论