2^(merged groups)
\n\n# Code\n\nclass Solution {\npublic:\n    const int mod = 1e9+7;\n    int fastExpo(int x,int y){\n        if(y<=1)return y?x:1;\n        long long  ans=fastE
\n\n# Code\n```\nclass Solution {\npublic:\n    const int mod = 1e9+7;\n    int fastExpo(int x,int y){\n        if(y<=1)return y?x:1;\n        long long  ans=fastExpo(x,y/2);\n        ans=(ans*ans)%mod;\n        if(y&1)ans=(ans*x)%mod;\n        return ans;\n    }\n    int countWays(vector<vector<int>>& ranges) {\n         sort(ranges.begin(),ranges.end());\n         vector<vector<int>> ans;\n         for(auto ele:ranges){\n             if(ans.empty() or ans.back().back() < ele[0])ans.push_back(ele);\n             else ans.back().back() = max(ans.back().back(), ele[1]);\n         } \n        return fastExpo(2,(int)size(ans));\n    }\n};\n```
['C++']