I lied. I actually have 2 problems:
Given n vertical line segments i.e. they are parallel to the y axis, find if there exists a straight line of any slope which passes through all the given line segments.
Given n lines such that none are parallel and there are nC2 intersection points, find the number of intersection points to the right of y axis and do this in most optimized time complexity.
I welcome all solutions :)