Hi monks! I have a question that I'm not able to answer properly... I have some ranges of numbers and I want to check if they have an overlap of, let's say, 5. For example, if you have 5-15 and 2-20 how can we confirm that yes, these ranges overlap by at least 5?
I have did the "preliminary" code, in order to collect for the given pairs the start and end numbers (5,2 and 15,20 respectively), as well as the length of each pair of numbers (11 and 19 respectively). My problem is I can't think of the mathematical algorithm in order to check the overlap between the two ranges of numbers.