[C++] Optimized Solution | 9 lines | beats 95% Time
\n    vector<vector<int>> insert(vector<vector<int>>& intervals, vector<int>& newInterval) {\n        int n = intervals.size(), i = 0;\n        vector<vector<in
```\n    vector<vector<int>> insert(vector<vector<int>>& intervals, vector<int>& newInterval) {\n        int n = intervals.size(), i = 0;\n        vector<vector<int>> res;\n        \n        while(i < n && intervals[i][1] < newInterval[0])    res.push_back(intervals[i++]);\n\t\t\n        while(i < n && newInterval[1] >= intervals[i][0]){\n            newInterval[0] = min(newInterval[0], intervals[i][0]);\n            newInterval[1] = max(newInterval[1], intervals[i][1]);\n            i++;\n        }\n        res.push_back(newInterval);\n        while(i < n)    res.push_back(intervals[i++]);\n        return res;\n    }\n```
['C', 'C++']