Problem
Ask
Submissions

Problem: Burst Balloons

Medium
30 min
Explore how to apply dynamic programming techniques to solve the Burst Balloons problem by optimizing the order of bursting balloons to maximize coin collection. Understand problem constraints and develop solutions that consider virtual balloon boundaries and multiplications for effective scoring.

Statement

You are given nn balloons, numbered from 00 to n1n - 1. Each balloon has a number painted on it, represented by an integer array nums.

When you burst a balloon ii, you earn coins equal to nums[i - 1] * nums[i] * nums[i + 1].
If either i1i - 1 or i+1i + 1 is out of bounds, assume there is a virtual balloon with the number 11 in its place.

Your task is to burst all the balloons to collect the maximum number of coins possible.

Return the maximum coins you can obtain by bursting the balloons in an optimal order.

Constraints:

  • n==n == nums.length

  • 1n1 \leq n \leq 300

  • 00 \leq nums[i] 100\leq 100

Problem
Ask
Submissions

Problem: Burst Balloons

Medium
30 min
Explore how to apply dynamic programming techniques to solve the Burst Balloons problem by optimizing the order of bursting balloons to maximize coin collection. Understand problem constraints and develop solutions that consider virtual balloon boundaries and multiplications for effective scoring.

Statement

You are given nn balloons, numbered from 00 to n1n - 1. Each balloon has a number painted on it, represented by an integer array nums.

When you burst a balloon ii, you earn coins equal to nums[i - 1] * nums[i] * nums[i + 1].
If either i1i - 1 or i+1i + 1 is out of bounds, assume there is a virtual balloon with the number 11 in its place.

Your task is to burst all the balloons to collect the maximum number of coins possible.

Return the maximum coins you can obtain by bursting the balloons in an optimal order.

Constraints:

  • n==n == nums.length

  • 1n1 \leq n \leq 300

  • 00 \leq nums[i] 100\leq 100