Beats 100%---->Simple Approach
Intuition\n Describe your first thoughts on how to solve this problem. \n\n# Approach\n Describe your approach to solving the problem. \n\n# Complexity\n- Time 
# Intuition\n<!-- Describe your first thoughts on how to solve this problem. -->\n\n# Approach\n<!-- Describe your approach to solving the problem. -->\n\n# Complexity\n- Time complexity:\n<!-- Add your time complexity here, e.g. $$O(n)$$ -->\n\n- Space complexity:\n<!-- Add your space complexity here, e.g. $$O(n)$$ -->\n\n# Code\n```cpp []\nclass Solution {\npublic:\n    int countWays(vector<vector<int>>& ranges) {\n        int ans = 0;\n        sort(ranges.begin(), ranges.end());\n        int s = -1, l = -1;\n\n        for (int i = 0; i < ranges.size(); i++) {\n            if (ranges[i][0] > l) {\n                s = ranges[i][0];\n                l = ranges[i][1];\n                ans++;\n            } else {\n                s = min(s, ranges[i][0]);\n                l = max(l, ranges[i][1]);\n            }\n        }\n        long long a = 1;\n        for (int i = 0; i < ans; i++) {\n            a = (a * 2) % 1000000007;\n        }\n        return a;\n    }\n};\n\n```
['C++']