```
int findMinArrowShots(vector<pair<int, int>>& points) {
int res = 0, i = 0, temp;
sort(points.begin(), points.end(), [](pair<int, int> a, pair<int, int> b){return a.second < b.second;});
while (i < points.size()) {
res++;
temp = points[i++].second;
while (i < points.size() && points[i].first <= temp) i++;
}
return res;
}
```