If you have two pairs of values, start and end- how do you compute where their overlap is?
I.e if the pairs of start and end values are
[10, 20], [15, 20]
In this case compute_overlap((15,20),(10,20))
should return (15,20)
because that is where the overlap is.
What is the best way to do this?