Simple C++
Code

# Code
```cpp []
class Solution {
public:
    int countWays(vector<vector<int>>& ranges) {
        int uniqueGroups = 1, mod = 1e9 + 7;
        sort(ranges.begin(), ranges.end());
        int left = 0, maxRange = ranges[left][1];
        for(int i=1; i<ranges.size(); i++) {
            if(ranges[i][0] > maxRange) {
                uniqueGroups *=2, uniqueGroups %=mod;
                left = i, maxRange = ranges[left][1];
            } else {
                maxRange = max(maxRange, ranges[i][1]);
            }
        }
        return (uniqueGroups * 2)%mod;
    }
};
```
['C++']