We can not choose pairs from these as they have same x coordinatethus they will result line segment parallel to y axis
total -= ( c * ( c - 1 ) ) / 2 ; } ) ; y_axis . forEach ( ( value , key ) => { var c = value ;