Help

How to find if two intervals overlap?

464 0
cancel
Showing results for 
Search instead for 
Did you mean: 

I’m trying to check if users input intervals in a correct usable way for my script to handle an input.

I expect my users to write something like
4-50=£54, -4=£45, +50=£89

I’ve split up every part into an arrays.
And I have the following array I want to check if the ranges overlap
[“4-50”,"-4", “+50”]

Does anyone know the best way to check if any of the ranges overlap?

0 Replies 0