Java || Memoization || O(N*N)
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    int res=Integer.MIN_VALUE;\n    public int find(int i, int j, List<List<Integer>> grid, int n, int m, int dp[][]){\n        if(i==n-1&&j==m-1) return 0;\n        if(dp[i][j]!=Integer.MIN_VALUE) return dp[i][j];\n        int max=Integer.MIN_VALUE;\n        if(i<n-1){\n            max=Math.max(max,grid.get(i+1).get(j)-grid.get(i).get(j)+Math.max(0,find(i+1,j,grid,n,m,dp)));\n        }\n        if(j<m-1){\n            max=Math.max(max,grid.get(i).get(j+1)-grid.get(i).get(j)+Math.max(0,find(i,j+1,grid,n,m,dp)));\n        }\n        dp[i][j]=max;\n        res=Math.max(res,dp[i][j]);\n        return dp[i][j];\n    }\n    public int maxScore(List<List<Integer>> grid) {\n        int n=grid.size();\n        int m=grid.get(0).size();\n        int dp[][]=new int[n+1][m+1];\n        for(int i=0;i<=n;i++){\n            for(int j=0;j<=m;j++) dp[i][j]=Integer.MIN_VALUE;\n        }\n        find(0,0,grid,n,m,dp);\n        return res;\n    }\n}\n```
['Java']