C++ Top Down Faster than 100%
\nclass Solution {\npublic:\n    int dp[105][105];\n    int minScore(vector<int>& A, int i, int k) {\n        if( k < i + 2)\n            return 0;\n        \n 
```\nclass Solution {\npublic:\n    int dp[105][105];\n    int minScore(vector<int>& A, int i, int k) {\n        if( k < i + 2)\n            return 0;\n        \n        if(dp[i][k] != -1)\n            return dp[i][k];\n        \n        int minm = INT_MAX;\n        \n        for(int j = i+1; j < k; j++) {\n            minm = min(minm, minScore(A,i,j) + minScore(A,j,k) + A[i]*A[j]*A[k]);\n        }\n        return dp[i][k] = minm;\n    }\n    int minScoreTriangulation(vector<int>& A) {\n        int i = 0, k = A.size()-1;\n        int n = A.size();\n        //dp.resize(n+1, vector<int>(n+1, -1));\n        memset(dp, -1, sizeof(dp));\n        return minScore(A, i, k);\n    }\n};\n```
[]