标签:begin pl2 for end png find info http cto
class Solution {
public:
int findMinArrowShots(vector<vector<int>>& points)
{
int len = points.size();
if (len == 0)
{
return 0;
}
sort(points.begin(), points.end(), [](const vector<int> &pl1, const vector<int> &pl2){
return pl1[1] < pl2[1];
});
int arrow = 1;
int endX = points[0][1];
for (int i = 1; i < len; i++)
{
if (points[i][0] > endX)
{
arrow++;
endX = points[i][1];
}
}
return arrow;
}
};
标签:begin pl2 for end png find info http cto
原文地址:https://www.cnblogs.com/woodjay/p/12387389.html