Minimum Number of Arrows to Burst Balloons

题目来源
这道题感觉不难,先排个序,然后从左向右扫描,保存扫描过的气球最大左边界和最小右边界,当最大左边界小于最小右边界时,需要射一箭。

class Solution {
public:
    int findMinArrowShots(vector>& points) {
        sort(points.begin(), points.end());
        int n = points.size(), res = 0;
        for (int i=0; i

你可能感兴趣的:(Minimum Number of Arrows to Burst Balloons)