What is the most efficient way to find the common intersection of given set of coordinates lies on x axis?

23 Views Asked by At

For example :

(1,6) and (2,4) have (2,4) common. 
(2,4) and (3,6) have (3,4) common. 

There can be N numbers of coordinates and we have to find the common 
intersection point among all those coordinates.
1

There are 1 best solutions below

0
On BEST ANSWER

If the intervals have a common intersection it should be $(a,b)$ where $a$ is the maximum value of all the left endpoints and $b$ is the minimum of all the right sides.

In case that the $b$ happens to be less than $a$ there is no common intersection.

Of course a graph will always be helpful.