闭区间的右部分,不断和后面的区间右部分比较并合并 class Solution { public: static bool cmp(Interval& a, Interval& b){ return a.start<b.start; } vector<Interval> merge(vector<Interval> &intervals) { //按区间左部分值排序 sort(intervals.begin(), intervals.end(), cmp); ...