Find number range intersection

前端 未结 5 1346
别那么骄傲
别那么骄傲 2020-12-10 05:43

What is the best way to find out whether two number ranges intersect?

My number range is 3023-7430, now I want to test which of the following number

5条回答
  •  刺人心
    刺人心 (楼主)
    2020-12-10 06:20

    If you're using Java Commons Lang Range has a overlapsRange(Range range) method.

提交回复
热议问题