python super easy dp top down
Intuition\n Describe your first thoughts on how to solve this problem. \n\n# Approach\n Describe your approach to solving the problem. \n\n# Complexity\n- Time 
# Intuition\n<!-- Describe your first thoughts on how to solve this problem. -->\n\n# Approach\n<!-- Describe your approach to solving the problem. -->\n\n# Complexity\n- Time complexity:\n<!-- Add your time complexity here, e.g. $$O(n)$$ -->\n\n- Space complexity:\n<!-- Add your space complexity here, e.g. $$O(n)$$ -->\n\n# Code\n```\nclass Solution:\n    def minScoreTriangulation(self, values: List[int]) -> int:\n\n\n        @functools.lru_cache(None)\n        def dp(l, r):\n            if r-l + 1 == 3:\n                return values[l] * values[l+1] * values[l+2]\n            if r-l + 1 < 3:\n                return 0\n            ans = float("inf")\n            for i in range(l+1, r):\n                ans = min(ans, values[l]*values[i]*values[r] + dp(l, i) + dp(i, r))\n            return ans\n        return dp(0, len(values)-1)\n\n```
['Python3']