Java Clean Solution
Complexity\n- Time complexity:O(n^2)\n Add your time complexity here, e.g. O(n) \n\n- Space complexity:O(n*m)\n Add your space complexity here, e.g. O(n) \n\n# 
# Complexity\n- Time complexity:$$O(n^2)$$\n<!-- Add your time complexity here, e.g. $$O(n)$$ -->\n\n- Space complexity:$$O(n*m)$$\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 row = grid.size();\n        int col = grid.get(0).size();\n\n        int[][] dp = new int[row][col];\n        for (int[] d : dp) {\n            Arrays.fill(d, Integer.MIN_VALUE);\n        }\n\n        dp[row - 1][col - 1] = grid.get(row - 1).get(col - 1);\n        for (int i = row - 1; i >= 0; i--) {\n            for (int j = col - 1; j >= 0; j--) {\n                if (i < row - 1) {\n                    dp[i][j] = Math.max(dp[i][j], dp[i + 1][j]);\n                }\n                if (j < col - 1) {\n                    dp[i][j] = Math.max(dp[i][j], dp[i][j + 1]);\n                }\n                dp[i][j] = Math.max(dp[i][j], grid.get(i).get(j));\n            }\n        }\n\n        int max = Integer.MIN_VALUE;\n        for (int i = 0; i < row; i++) {\n            for (int j = 0; j < col; j++) {\n                if (i < row - 1) {\n                    max = Math.max(max, dp[i + 1][j] - grid.get(i).get(j));\n                }\n                if (j < col - 1) {\n                    max = Math.max(max, dp[i][j + 1] - grid.get(i).get(j));\n                }\n            }\n        }\n        return max;\n    }\n}\n```
['Array', 'Math', 'Dynamic Programming', 'Recursion', 'Matrix', 'Java']