How can improve it?

I saw a group of c++ submission that is under 50ms in chart.

Can anyone tell me how to achieve that?

Or guide me to the link if already posted?

Thanks

```
class Solution {
public:
bool static wayToSort(Interval i, Interval j)
{
return i.start < j.start;
}
vector<Interval> merge(vector<Interval>& intervals) {
vector<Interval> newVec;
if(intervals.size()==0)
return newVec;
std::sort(intervals.begin(), intervals.end(), wayToSort);
newVec.push_back(intervals[0]);
for(int i=1; i<intervals.size(); i++)
{
if(intervals[i].start<=newVec.back().end)
newVec.back().end = std::max(newVec.back().end, intervals[i].end);
else
newVec.push_back(intervals[i]);
}
return newVec;
}
};
```