JAVA|| HARD TO UNDERSTAD CODE
class Solution {\n    public int minScoreTriangulation(int[] arr) {\n        int n=arr.length;\n        int dp[][] = new int[101][101];\n        for(int i=0;i<1
class Solution {\n    public int minScoreTriangulation(int[] arr) {\n        int n=arr.length;\n        int dp[][] = new int[101][101];\n        for(int i=0;i<101;i++){\n            for(int j=0;j<101;j++){\n                dp[i][j]=-1;\n            }\n        }\n        return solve(arr,1,n-1,dp);\n        \n    }\n    public int solve(int[] arr ,int i,int j,int[][]dp){\n        if(i>=j){\n            return 0;\n            \n        }\n        if(dp[i][j]!=-1){\n            return dp[i][j];\n            \n        }\n        int mn= Integer.MAX_VALUE;\n        for(int k=i;k<j;k++){\n            int tempans = solve(arr,i,k,dp)+solve(arr,k+1,j,dp)+arr[i-1]*arr[k]*arr[j];\n            mn=Math.min(mn,tempans);\n        }\n        dp[i][j]=mn;\n        return dp[i][j];\n    }\n}
[]