Key observation: **any balloons with common range could be burst using a single arrow**, so the problem is simply to ask **how many disjoint common ranges formed by given balloons**?

Sort all balloons { B_{i=1:N} } by left edge x-coordinates. Note that if balloon subset { B_{i} } has a non-empty common range, clearly, we have

- common range [L, R] = [max
_{i}B_{i}.left, min_{i}B_{i}.right].

The position of current balloon B_{cur} v.s. last common range is either

- intersecting, i.e., B
_{cur}.left ≤ R, which means no addition arrow needed and we update to shrink the common range, - or disjoint, which means we discard the last common range since current balloon becomes the new common range, and we need a new arrow to burst it.

```
int findMinArrowShots(vector<pair<int, int>>& points) {
sort(points.begin(), points.end(), [](pair<int, int>& a, pair<int, int>& b){return a.first<b.first;});
int res = 1; pair<int, int> common(INT_MIN, INT_MAX);
for (auto& p:points)
common = (p.first > common.second)? (++res,p) : make_pair(p.first, min(common.second, p.second));
return points.empty()? 0 : res;
}
```