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.
Java
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.