Python solution
\nclass Solution:\n    def maxCoins(self, nums):\n        nums, N = [1] + nums + [1], len(nums) + 2 #array with 1,1 balloons at the end and length as N\n       
```\nclass Solution:\n    def maxCoins(self, nums):\n        nums, N = [1] + nums + [1], len(nums) + 2 #array with 1,1 balloons at the end and length as N\n        dp = [[0] * N for _ in range(N)] # table full of zeros\n        \n        for left in range(N - 2, -1, -1):\n            for right in range(left + 2, N):\n                dp[left][right] = max(nums[left]*nums[i]*nums[right] + dp[left][i] + dp[i][right] for i in range(left + 1, right))\n        \n        return dp[0][N-1]\n```
['Python']