I have two arrays and I need to check for any duplicate ranges. How can I achieve this?
let startingArray = ['1', '6.1', '10', '31','6.2',3];
let endingArray = ['2', '9.9', '30', '401','7',5];
How can we test for duplicate ranges? Here is the expected result:
1-2 -valid
6.1 - 9.9 -valid
10 - 30-valid
31 - 401 -valid
6.2 - 7 -invalid (inside range of 6.1 - 9.9)
3-5 - valid
Please help me find a solution to this problem.