Problem
Ask
Submissions

Problem: Burst Balloons

Medium
30 min
Explore how to apply dynamic programming principles to solve the Burst Balloons problem effectively. Understand how to maximize coin collection by determining the optimal order to burst balloons and develop skills in handling complex optimization challenges relevant to coding interviews.

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 principles to solve the Burst Balloons problem effectively. Understand how to maximize coin collection by determining the optimal order to burst balloons and develop skills in handling complex optimization challenges relevant to coding interviews.

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