PYTHON SOL || RECURSION + MEMO || EXPLAINED || WITH PICTURES ||
EXPLAINED\n\nWe need to make n-2 triangles -> For this we need to remove n -3 triangles from polygon\n\nNow a polygon with side say 6 can have multiple ways to 
# EXPLAINED\n```\nWe need to make n-2 triangles -> For this we need to remove n -3 triangles from polygon\n\nNow a polygon with side say 6 can have multiple ways to remove triangle ( multiple triangle)\n\nSo here comes DP\nWe try each traingle ony by one\n\n```\n![image](https://assets.leetcode.com/users/images/cbfc75c4-a5b6-4dee-bab7-ca8a3e4616d2_1652447020.0085542.png)\n![image](https://assets.leetcode.com/users/images/f2e5b630-e172-4486-b02e-fa4bb903a5b4_1652447030.4787142.png)\n\n\n\n\n\n\n# CODE\n```\nclass Solution:\n    def recursion(self,start,end):\n        if start >= end :\n            return 0\n        \n        if self.dp[start][end] != -1 : return self.dp[start][end]\n\n        best = float(\'inf\')\n        \n        for mid in range(start,end):\n            tmp = self.recursion(start,mid) + self.recursion(mid+1,end) + \\\n            self.values[start-1]*self.values[mid]*self.values[end]\n            if tmp < best: best = tmp\n        \n        self.dp[start][end] = best\n        return best\n    \n    def minScoreTriangulation(self, values: List[int]) -> int:\n        n = len(values)\n        self.dp = [[-1 for i in range(n)] for j in range(n)]\n        self.values = values\n        return self.recursion(1,n-1)\n```
['Dynamic Programming', 'Recursion', 'Memoization', 'Python', 'Python3']