Easy C++ solution || O(N) Time complexity || 11 Line code
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```\nclass Solution {\npublic:\n    long long mod=1000000000+7;\n    \n    int countWays(vector<vector<int>>& ranges) {\n        int cnt=1;\n        sort(ranges.begin(),ranges.end());\n        int mx=ranges[0][1];\n        for(int i=1;i<ranges.size();i++)\n        {\n            if(ranges[i][0]>mx)\n                cnt++;\n            mx=max(mx,ranges[i][1]);\n            // cout<<ranges[i][0]<<" "<<ranges[i][1]<<endl;\n        }\n        long long ans=1;\n        while(cnt--)\n            ans=(ans*2)%mod;\n        // cout<<cnt<<endl;\n        // long long k=pow(2,cnt);\n        return (ans%mod);\n    }\n};\n```
['C++']