Tap here to switch tabs
Problem
Submissions

Problem: Minimum Number of Arrows to Burst Balloons

med
30 min
Try to solve the Minimum Number of Arrows to Burst Balloons problem.

Statement

You are given a list points, where each element points[i] = [x_start, x_end] represents a balloon whose horizontal diameter spans from x_start to x_end on the x axis. An arrow can be shot vertically at any x coordinate x, and it bursts every balloon satisfying x_start <= x <= x_end.

Return the minimum number of arrows required to burst all balloons.

Constraints:

  • 1≤1 \leq points.length ≤105\leq 10^5

  • points[i].length ==2== 2

  • −231≤-2^{31} \leq x_start << x_end ≤231−1\leq 2^{31} - 1

⋮
Tap here to switch tabs
Problem
Submissions

Problem: Minimum Number of Arrows to Burst Balloons

med
30 min
Try to solve the Minimum Number of Arrows to Burst Balloons problem.

Statement

You are given a list points, where each element points[i] = [x_start, x_end] represents a balloon whose horizontal diameter spans from x_start to x_end on the x axis. An arrow can be shot vertically at any x coordinate x, and it bursts every balloon satisfying x_start <= x <= x_end.

Return the minimum number of arrows required to burst all balloons.

Constraints:

  • 1≤1 \leq points.length ≤105\leq 10^5

  • points[i].length ==2== 2

  • −231≤-2^{31} \leq x_start << x_end ≤231−1\leq 2^{31} - 1