Sorting&&Merging||C++ Solution
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:O(N)\n<!-- Add your time complexity here, e.g. $$O(n)$$ -->\n\n- Space complexity:O(1)\n<!-- Add your space complexity here, e.g. $$O(n)$$ -->\n\n# Code\n```\nclass Solution {\npublic:\n    int countWays(vector<vector<int>>& ranges) {\n        //answer is 2 ki power no_of_non_overlapping_grps\n        const int mod=1e9+7;\n        sort(ranges.begin(),ranges.end());\n        int cnt=1;\n        int pvs=ranges[0][1];\n        for(int i=1;i<ranges.size();i++){\n            if(ranges[i][0]<=pvs){\n                pvs=max(pvs,ranges[i][1]);\n                continue;\n            }else{\n                pvs=ranges[i][1];\n                cnt++;\n            }\n        }\n        int ans=1;\n        for(int i=1;i<=cnt;i++){\n            ans=(ans*2)%mod;\n        }\n        return (ans%mod);\n    }\n};\n```
['Sorting', 'C++']