What is the best way to count number of intersections of a given set of ranges.
For ex: consider a list of range pairs[start,stop]
[[1,5], [3,7], [9,11], [6,8]]
Here there are total 2 intersections ,
[1,5] intersects with [3,7]
and [3,7] intersects with [6,8]