As reported: Goldman Sachs Analyst Superday, round 4 (2025): Burst Balloons, then a search in a partially shuffled sorted array.
Balloons have values nums. Bursting balloon i earns nums[left] · nums[i] · nums[right] with its current neighbours (out-of-range neighbours count as 1); then the neighbours become adjacent. Return the maximum total coins.
This is LeetCode 312 — Burst Balloons.
Example 1
nums = [3,1,5,8]
-> 167
Example 2
nums = [1,5]
-> 10
Constraints: 1 ≤ n ≤ 300; 0 ≤ nums[i] ≤ 100.
Code runner format: one JSON value per line: nums (LeetCode's test-case format). Implement maxCoins(nums); the harness prints the result as JSON.