149 Max Points on a Line

149
Max Points on a Line
13.0%
Hard
不优化,直接数
数个数用HashMap

public class Solution {
    public int maxPoints(Point[] points) {
        if (points.length<=2) return points.length;
        int max = 2;
        for (int i=0;i counter = new HashMap();
            for (int j=i+1;j

优化

你可能感兴趣的:(149 Max Points on a Line)