Approach Summary
Sort by end. Shoot an arrow at the first balloon's end. Skip all overlapping balloons. Repeat — each overlap group needs one arrow.
How to Recognize This Pattern
- "Minimum arrows to pop all overlapping intervals"
- Greedy: one arrow at the earliest end covers all overlapping
Complexity Analysis
Time Complexity
O(n log n)
Space Complexity
O(1)
Tags
Array Greedy Sorting