C++✅ || Simple || Memoization code
\nclass Solution {\nprivate:\n\tint helper(vector<int> &nums, int i, int j, vector<vector<int>> &dp) {\n\t\tif (j - i <= 1) return 0; // no triangle\n\t\tif (dp
```\nclass Solution {\nprivate:\n\tint helper(vector<int> &nums, int i, int j, vector<vector<int>> &dp) {\n\t\tif (j - i <= 1) return 0; // no triangle\n\t\tif (dp[i][j] != -1) return dp[i][j];\n\t\tint mini = 1e9;\n\t\tfor (int ind = i + 1; ind < j; ++ind) {\n\t\t\tint cost = nums[i] * nums[ind] * nums[j] + helper(nums, i, ind, dp) + helper(nums, ind, j, dp);\n\t\t\tmini = min(mini, cost);\n\t\t}\n\t\treturn dp[i][j] = mini;\n\t}\npublic:\n    int minScoreTriangulation(vector<int>& nums) {\n\t\tint n = nums.size();\n\t\tvector<vector<int>> dp(n + 1, vector<int>(n + 1, -1));\n\t\treturn helper(nums, 0, n - 1, dp);\n    }\n};\n```
['C']