c++ solution bottom up approach
Bottom up  Approach \nusing gap strategy\n\nclass Solution {\npublic:\n    int maxCoins(vector<int>& nums) {\n        int n = nums.size();\n        int dp[n][n]
*Bottom up  Approach *\n*using gap strategy*\n```\nclass Solution {\npublic:\n    int maxCoins(vector<int>& nums) {\n        int n = nums.size();\n        int dp[n][n];\n        for(int gap =0; gap <n; gap++){\n            for(int i =0 , j = gap; j<n; i++,j++){\n                int max_ = INT_MIN;\n                for(int k = i ; k<=j; k++) {\n                    int left = k ==i ?0 : dp[i][k-1];\n                    int right = k == j?0 : dp[k+1][j];\n                    int val = (i==0? 1: nums[i-1]) * nums[k] * (j==nums.size() -1? 1: nums[j+1]);\n                    int total = left+ right + val;\n                    if(total > max_) max_ = total;\n                    \n               }\n            dp[i][j] = max_;   \n            } \n        }\n       return dp[0][n-1];\n    }\n};\n```\ncomment below if have dobuts and upvote!!
['Dynamic Programming', 'C', 'C++']