Z39
Burst Balloons
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]) -> intInput & Output Contract
Output Rule:Kazanılan maksimum puan.
System Constraints
1 <= sayilar.length <= 300
0 <= sayilar[i] <= 100Example 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: 167Example Test Scenarios (3)
Example 1
Input:
[[3,1,5,8]]Expected Output:
167Example 2
Input:
[[1,5]]Expected Output:
10Example 3: Tek Balon (1*7*1)
Input:
[[7]]Expected Output:
7