I have array of ranges :
[[39600..82800], [39600..70200],[70200..80480]]
I need to determine if there is overlapping or not.What is an easy
Is this not a way to do it?
def any_overlapping_ranges(array_of_ranges) array_of_ranges.sort_by(&:first).each_cons(2).any?{|x,y|x.last>y.first} end p any_overlapping_ranges([50..100, 1..51,200..220]) #=> True