https://leetcode.cn/problems/check-if-all-the-integers-in-a-range-are-covered/description/
class Solution {
public:
bool isCovered(vector<vector
vector
for(auto a:ranges){
++diff[a[0]];
--diff[a[1]+1];
}
int count=0;
for(int i=0;i<=50;i++){
count+=diff[i];
if(i>=left&&i<=right&&count<=0)
return false;
}
return true;
}
};