← 返回 ibm 的题目列表Count Ways to Split Overlapping Ranges into Two Groups
类型:online_judge
ibm
A list of ranges contains the start and end values depicting continuous integer ranges. For example, [1, 4] includes integers in the range 1 to 4, or [7, 8] includes 7 to 8. Divide these ranges into two groups ensuring each group has at least one range. Return the total number of ways to split the ranges into 2 groups, considering the result may be large, return modulo 10^9 + 7.
Constraints
ranges[i] is an array with two integers representing the start and end points
Every pair of ranges has at least one common integer
Example
Input
2
1 5
3 8