C++ beats 100%
\nclass Solution {\npublic:\n    int maxCoins(vector<int>& nums) {\n        int n  = nums.size();\n        /// Insert two 1s in the begining and in the end.\n  
```\nclass Solution {\npublic:\n    int maxCoins(vector<int>& nums) {\n        int n  = nums.size();\n        /// Insert two 1s in the begining and in the end.\n        nums.insert(nums.begin(), 1);\n        nums.push_back(1);\n        \n        vector<vector<int>> c(n+2, vector<int>(n+2, 0));\n        for(int l  = 1; l <=n ; ++l) {\n            for (int i = 1; i <= n-l+1; ++i) {\n                int j = i + l -1;\n                for(int k = i; k <= j; ++k) {\n                    c[i][j] = max(c[i][j], c[i][k-1]+ nums[i-1]*nums[k]*nums[j+1] + c[k+1][j]);\n                }\n            }\n        }\n        return c[1][n];\n    }\n};\n```
[]