原题题目
代码实现(首刷自解)
class Solution {
public:int removeCoveredIntervals(vector<vector<int>>& intervals) {
int ret = intervals.size();sort(intervals.begin(),intervals.end(),[](auto&a,auto&b){
return a[0]<b[0]||a[0]==b[0]&&a[1]>b[1];});int l = intervals[0][0],r = intervals[0][1];for(int i=1;i<intervals.size();++i){
if(intervals[i][1] > r){
l = intervals[i][0];r = intervals[i][1];continue;}--ret;}return ret;}
};