Code RoomBurst balloons with arrows
MediumPrep Room Coding #1220

Burst balloons with arrows

CodingAlgorithms & data structuresMid–Senior~20 min

Given a list of closed intervals `points[i] = [start, end]` representing balloons on a number line, you shoot arrows straight up. An arrow at x-coordinate `p` bursts every balloon whose interval contains p (start <= p <= end, inclusive on both ends). Return the minimum number of arrows needed to burst all balloons. Up to 10^5 intervals; coordinates are 32-bit ints. This is the minimum-stabbing-points problem — sort by end and greedily place arrows.

Implement
min_arrows(points: list[list[int]]) → int
Examples
in[[[10,16],[2,8],[1,6],[7,12]]]out2
What a strong answer looks like

State your approach and its time/space complexity out loud before you optimize. Handle the edge cases (empty input, duplicates, overflow), and say why you chose this over the brute force. Green tests are the floor, not the grade.

0:00 of about 20 min
InputExpectedGot
[[[10,16],[2,8],[1,6],[7,12]]]2not run yetsample