Home  >  Article  >  Backend Development  >  请教怎么有效判断几组数据范围是否有交集

请教怎么有效判断几组数据范围是否有交集

WBOY
WBOYOriginal
2016-06-13 12:36:131011browse

请问如何有效判断几组数据范围是否有交集
5000~7000
2000~6000
8000~9000
4000~8500
5000~7000
请问php中这几组随机的数据怎么样更有效的判断是否有重复?

期望值是
2000~4000
4000~5000
5000~6000
6000~7000
7000~8500
8500~9000

php
Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn