标签:tps min insert pre 区间 return ack ble etc
class Solution {
public:
vector<vector<int>> insert(vector<vector<int>>& a, vector<int>& b) {
vector<vector<int>> ans;
int k = 0;
while(k < a.size() && a[k][1] < b[0]) ans.push_back(a[k++]);
if (k < a.size()) {
b[0] = min(b[0], a[k][0]);
while (k < a.size() && a[k][0] <= b[1]) b[1] = max(b[1], a[k++][1]);
}
ans.push_back(b);
while (k < a.size()) ans.push_back(a[k++]);
return ans;
}
};
标签:tps min insert pre 区间 return ack ble etc
原文地址:https://www.cnblogs.com/clown9804/p/13261934.html