Z39

Burst Balloons

Staff / Principal Engineer
Target Time: 40 - 50 Minutes
Type: NUMERIC

Problem Statement & Objective

You are given n balloons, indexed from 0 to n - 1. Each balloon is painted with a number on it. Burst them to maximize the total collected coins.

Function Signature (Python)

burst_balloons(nums: list[int]) -> int

Input & Output Contract

Output Rule:Kazanılan maksimum puan.

System Constraints

1 <= sayilar.length <= 300
0 <= sayilar[i] <= 100

Example Execution Walkthrough

sayilar = [3, 1, 5, 8]
1'i patlat: 3*1*5=15
5'i patlat: 3*5*8=120
3'ü patlat: 1*3*8=24
8'i patlat: 1*8*1=8
toplam: 167

Example Test Scenarios (3)

Example 1
Input:[[3,1,5,8]]
Expected Output:167
Example 2
Input:[[1,5]]
Expected Output:10
Example 3: Tek Balon (1*7*1)
Input:[[7]]
Expected Output:7
Loading Python Editor...
Input Parameters
[
  [
    3,
    1,
    5,
    8
  ]
]
Expected Output
167