暴力解
class Solution {
public:
vector<vector<int>> merge(vector<vector<int>>& intervals) {
sort(intervals.begin(),intervals.end());
vector<vector<int>> out;
out.push_back(intervals[0]);
// cout<<"sjl"<<endl;
for(int i=1;i<intervals.size();i++){
int n=out.size();
if(out[n-1][1]>=intervals[i][0]){
out[n-1][1]=max(out[n-1][1],intervals[i][1]);
}else{
out.push_back(intervals[i]);
}
}
return out;
}
};