Minimum Number of Arrows to Burst Balloons
Solve this the way you would in the interview: out loud, on a timer, with an AI interviewer asking follow-ups while you code. You get a scored report at the end.
Practice this as a mock interviewFree to start, no account neededProblem
Balloons are taped to a wall along the x-axis. Each balloon is given as points[i] = [start, end], meaning it covers every x from start to end inclusive.
An arrow shot straight up at position x bursts every balloon with start <= x <= end, and keeps flying. Balloons that only touch at an endpoint can be burst by one arrow at that shared coordinate.
Return the minimum number of arrows needed to burst all balloons.
Examples
Constraints
- 1 <= points.length <= 10^5
- points[i].length == 2
- -2^31 <= start <= end <= 2^31 - 1
What the interviewer grades
A correct solution is one of five scores. The report also grades problem understanding (did you clarify inputs and edge cases before coding), problem solving, communication while you work, code quality, and testing. See a sample report, or read up on the pattern in the lessons.