SIMPLE RECURSION + MEMO C++ SOLUTION 
IntuitionApproachComplexity
Time complexity:

Space complexity:
Code
# Intuition
<!-- Describe your first thoughts on how to solve this problem. -->

# Approach
<!-- Describe your approach to solving the problem. -->

# Complexity
- Time complexity:
<!-- Add your time complexity here, e.g. $$O(n)$$ -->

- Space complexity:
<!-- Add your space complexity here, e.g. $$O(n)$$ -->

# Code
```cpp []
class Solution {
public:
    int m, n;
    vector<vector<int>> dp;

    int solve(int i, int j, vector<vector<int>>& grid) {
        if (i >= m || j >= n) return 0;
        if (dp[i][j] != -1) return dp[i][j];

        int pick1 = INT_MIN, pick2 = INT_MIN;
        if (i + 1 < m) pick1 = grid[i + 1][j] - grid[i][j] + solve(i + 1, j, grid);
        if (j + 1 < n) pick2 = grid[i][j + 1] - grid[i][j] + solve(i, j + 1, grid);

        dp[i][j] = max(0, max(pick1, pick2));
        return dp[i][j];
    }

    int maxScore(vector<vector<int>>& grid) {
        m = grid.size();
        n = grid[0].size();
        dp = vector<vector<int>>(m, vector<int>(n, -1));
        int maxi = INT_MIN;
        int maxi1 = INT_MIN;
        for (int i = 0; i < m; i++) {
            for (int j = 0; j < n; j++) {
                maxi = max(maxi, solve(i, j, grid));
                if (i + 1 < m) maxi1 = max(maxi1, grid[i + 1][j] - grid[i][j]);
                if (j + 1 < n) maxi1 = max(maxi1, grid[i][j + 1] - grid[i][j]);
            }
        }
        if (maxi == 0) return maxi1;
        return maxi;
    }
};

```
['C++']