Python3 Solution, top-down DP.
Python\nfrom functools import lru_cache\n\n\nclass Solution:\n    def maxCoins(self, nums: List[int]) -> int:\n        nums = [1] + nums + [1]\n        @lru_cac
```Python\nfrom functools import lru_cache\n\n\nclass Solution:\n    def maxCoins(self, nums: List[int]) -> int:\n        nums = [1] + nums + [1]\n        @lru_cache(None)\n        def dp(i, j):\n            """dp(i, j) represents the maximum coins after bursting all baloons between i and j."""\n            if i > j:\n                return 0\n            if i == j:\n                return nums[i-1] * nums[i] * nums[i+1]\n            return max(dp(i, k-1) + dp(k+1, j) + nums[i-1] * nums[k] * nums[j+1] for k in range(i, j+1))\n        return dp(1, len(nums) - 2)\n```
['Dynamic Programming', 'Python', 'Python3']