Say I have a list of lists that has indexes [[start, end], [start1, end1], [start2, end2]].
Like for example :
[[0, 133], [78, 100], [25,
In general, two intervals are overlapping if:
min([upperBoundOfA, upperBoundOfB]) >= max([lowerBoundOfA, lowerBoundOfB])
If this is the case, the union of those intervals is:
(min([lowerBoundOfA, lowerBoundOfB]), max([upperBoundOfA, upperBoundOfB])
Similarly, the intersection of those intervals will be:
(min([upperBoundOfA, upperBoundOfB]), max([lowerBoundOfA, lowerBoundOfB]))