Pop balloons to find the largest coins. Array . Add virtual 1s at ends: . The trick: instead of "which to pop first", think "which to pop last in interval". = max coins from popping all balloons in exclusive, assuming and are still there.
For interval (all real balloons): try each as last. If is last: . Compute recursively.