FastPrepMinimum Arrows to Burst Balloons
Problems/Minimum Arrows to Burst Balloons

Minimum Arrows to Burst Balloons

Adobe logoAdobe● MediumFULLTIMEPHONE SCREEN
QuestionFunctionExamplesConstraints

Problem statement

Source note: This problem asks for the fewest vertical arrows that burst a set of balloons, where each balloon covers a closed span of positions and an arrow bursts every balloon whose span contains its position. An Adobe Computer Scientist report gives this as the first of two coding questions in its first DSA round, only as a link to the well-known balloon-and-arrows problem; it states no rules, limits or examples of its own.

Our choices: the usual rules of that problem (ends included, so balloons that only touch share an arrow), at most 2000 balloons with ends anywhere in the 32-bit range, and new examples.

The judged task matches the report at about 90%.

Balloons are fixed along a wall. Balloon i covers every horizontal position from balloons[i][0] to balloons[i][1], ends included.

An arrow shot straight up from position x bursts every balloon whose span contains x; it keeps flying, so one arrow can burst many balloons. Return the fewest arrows that burst every balloon.

Function

minArrows(balloons: int[][]) → int

Examples

Example 1

balloons = [[3,9],[1,4],[7,12],[10,11]]return = 2

An arrow at 4 bursts [1, 4] and [3, 9]. An arrow at 11 bursts [7, 12] and [10, 11]. One arrow cannot do it: [1, 4] and [10, 11] share no position.

Example 2

balloons = [[0,2],[2,4],[5,5]]return = 2

[0, 2] and [2, 4] touch at 2, so one arrow at 2 bursts both. [5, 5] needs its own arrow at 5.

Example 3

balloons = [[1,10],[2,3],[5,6]]return = 2

[2, 3] and [5, 6] share no position, so at least two arrows are needed. Arrows at 3 and 6 work, and the wide balloon [1, 10] is burst by either.

Constraints

  • 1 <= balloons.length <= 2000
  • each balloons[i] = [start, end] with -2^31 <= start <= end <= 2^31 - 1

More Adobe problems

  • Evaluate a Parenthesized Integer ExpressionPHONE SCREEN · Seen Oct 2026
  • All Elements of Two BSTs in OrderPHONE SCREEN · Seen Aug 2026
  • Rotate an Array In PlaceOA · PHONE SCREEN · Seen Aug 2026
All Adobe interview questionsSee Adobe hiring insights
Saved
public int minArrows(int[][] balloons) {
    // Write your code here.
}
Checking account…