Minimum Number of Arrows to Burst Balloons
There are some spherical balloons taped onto a flat wall that represents the XY-plane. The balloons are represented as a 2D integer array points where points[i] = [xstart, xend] denotes a balloon whose horizontal diameter stretches between xstart and xend. You need to find the minimum number of arrows that must be shot to burst all balloons. An arrow can be shot at any integer x coordinate. A balloon with xstart and xend is burst by an arrow shot at x if xstart <= x <= xend.
Minimum Number of Arrows to Burst Balloons

There are some spherical balloons taped onto a flat wall that represents the XY-plane. The balloons are represented as a 2D integer array points where points[i] = [xstart, xend] denotes a balloon whose horizontal diameter stretches between xstart and xend. You need to find the minimum number of arrows that must be shot to burst all balloons. An arrow can be shot at any integer x coordinate. A balloon with xstart and xend is burst by an arrow shot at x if xstart <= x <= xend.

Example 1:
Input: [[10,16],[2,8],[1,6],[7,12]]
Output: 2
Input
arr =[[10,16],[2,8],[1,6],[7,12]]

Sort balloons by end position, place first arrow

1

16

[1,6]

[2,8]

[7,12]

[10,16]

Arrows needed:

1

Current Balloon

Arrow

Current End

Variables
No variables to display
DepthFunction Call
Stack empty
0/4