public static int findMaxPointsOnSameLine(int[][] points) {

        int maxPoints = 0;
        if(points == null) {
            return maxPoints;
        }


        Map<Double, Integer> slopMap = new HashMap<>();

        for( int i = 0; i< points.length; i++) {
            for( int j = i+1; j<points.length; j++) {

                if(points[j][0] - points[i][0] != 0) {
                    double slope = ((double)points[j][1] - (double)points[i][1])/((double)(double)points[j][0] - (double)points[i][0]) ;
                    if(!slopMap.containsKey(slope)) {
                        slopMap.put(slope, 0);
                    }
                    slopMap.put(slope, slopMap.get(slope) +1);

                    if(slopMap.get(slope) > maxPoints) {
                        maxPoints = slopMap.get(slope);
                    }
                }

            }
        }

        return maxPoints;
    }