Java solution || Using 2D array to store max till that point from bottom end||
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    public int maxScore(List<List<Integer>> grid) {\n        int m=grid.size(),n=grid.get(0).size();\n        int[][] dp=new int[m][n];\n        dp[m-1][n-1]=grid.get(m-1).get(n-1);\n        int ans=Integer.MIN_VALUE;\n        for(int i=n-2;i>=0;i--){\n            ans=Math.max(ans,dp[m-1][i+1]-grid.get(m-1).get(i));\n            dp[m-1][i]=Math.max(grid.get(m-1).get(i),dp[m-1][i+1]);\n            //ans=Math.max(ans,dp[m-1][i]-grid.get(m-1).get(i));\n            \n        }\n        //System.out.println(ans);\n        for(int i=m-2;i>=0;i--){\n            ans=Math.max(ans,dp[i+1][n-1]-grid.get(i).get(n-1));\n            dp[i][n-1]=Math.max(grid.get(i).get(n-1),dp[i+1][n-1]);\n            //ans=Math.max(ans,dp[i][n-1]-grid.get(i).get(n-1));\n            \n        }\n        //System.out.println(ans);\n        for(int i=m-2;i>=0;i--){\n            for(int j=n-2;j>=0;j--){\n                ans=Math.max(ans,\n                Math.max(\n                    dp[i+1][j]-grid.get(i).get(j),\n                    dp[i][j+1]-grid.get(i).get(j)\n                    )\n                );\n                dp[i][j]=Math.max(grid.get(i).get(j),Math.max(dp[i+1][j],dp[i][j+1]));\n                //ans=Math.max(ans,dp[i][j]-grid.get(i).get(j));\n            }\n        }\n        //System.out.println(ans);\n        return ans;\n        \n        \n    }\n}\n```
['Java']