Hints — p84 Min Arrows to Burst Balloons

  1. Each arrow bursts a contiguous “cluster” of overlapping balloons. Goal: partition into min clusters.

  2. 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.

  3. Walk left to right. Maintain arrow = end of the most recently committed interval. For each new [s, e]: if s > arrow, commit a new arrow at e.

  4. Exchange argument: stabbing at the smallest end can only cover more later intervals (since later starts are ≥ this start in some optimal ordering).

  5. Touching endpoints (closed intervals): [[1,2],[2,3]] share x=2 → 1 arrow. Use strict > not >=.

If stuck: see solution.py.