```
/**
* @param {number[][]} points
* @return {number}
*/
var findMinArrowShots = function(points) {
let result = 0,
len = points.length,
max = -Number.MAX_VALUE;
points.sort((a, b) => a[0]-b[0] || a[1]-b[1]);
for (let i = 0; i < len; i++) {
if (points[i][0] > max) {
result++;
max = points[i][1];
}
max = Math.min(max, points[i][1]);
}
return result;
};
```