Hints — p84 Min Arrows to Burst Balloons
-
Each arrow bursts a contiguous “cluster” of overlapping balloons. Goal: partition into min clusters.
-
Sort by END (not start). Counterexample to start-sort:
[[1,100],[2,3],[4,5]]— start-sort puts the wide one first and misleads the greedy. -
Walk left to right. Maintain
arrow= end of the most recently committed interval. For each new[s, e]: ifs > arrow, commit a new arrow ate. -
Exchange argument: stabbing at the smallest end can only cover more later intervals (since later starts are ≥ this start in some optimal ordering).
-
Touching endpoints (closed intervals):
[[1,2],[2,3]]share x=2 → 1 arrow. Use strict>not>=.
If stuck: see solution.py.