This will store the number of points has same x or y coordinates using the map as the value of coordinate can be very large
var x_axis = new Map ( ) , y_axis = new Map ( ) ; for ( var i = 0 ; i < n ; i ++ ) {