Merge and Power
First, we need to "merge" overlapping intervals, so that we have m non-overlapping intervals.\n\nWe can put each interval in any of two groups, so the total num
First, we need to "merge" overlapping intervals, so that we have `m` non-overlapping intervals.\n\nWe can put each interval in any of two groups, so the total number of splits is `2 ^ m`.\n\nSo, we sort `ranges`, and multiply the result by 2 when we detect a new non-overlapping interval.\n\n**Python 3**\n```python\nclass Solution:\n    def countWays(self, ranges: List[List[int]]) -> int:\n        end_max, res = -1, 1\n        for start_i, end_i in sorted(ranges):\n            res = res * (2 if end_max < start_i else 1) % 1000000007\n            end_max = max(end_max, end_i)\n        return res\n```
['Python3']