Easy C++ || Memoization Soln 
Code
# Code
```cpp []
class Solution {
public:
    int dp[501][501][3];
    int f(int r, int c, int neu, vector<vector<int>>& grid, int n, int m) {
        if (neu > 2 || r >= n || c >= m) return -1e8;
        if (r == n - 1 && c == m - 1) {
            if (grid[r][c] > 0) return grid[r][c];
            return neu < 2 ? 0 : grid[r][c];
        }
        if (dp[r][c][neu] != -1) return dp[r][c][neu];

        // All different ways
        int right = grid[r][c] + f(r, c + 1, neu, grid, n, m);
        int down = grid[r][c] + f(r + 1, c, neu, grid, n, m);
        int neuR = -1e8;
        if (grid[r][c] < 0 && neu < 2) neuR = f(r + 1, c, neu + 1, grid, n, m);
        int neuD = -1e8;
        if (grid[r][c] < 0 && neu < 2) neuD = f(r, c + 1, neu + 1, grid, n, m);

        if (grid[r][c] > 0) return dp[r][c][neu] = max(right, down);
        else return dp[r][c][neu] = max({right, down, neuD, neuR});
    }

    int maximumAmount(vector<vector<int>>& grid) {
        int n = grid.size(), m = grid[0].size();
        memset(dp, -1, sizeof(dp));
        return f(0, 0, 0, grid, n, m);
    }
};
```
['Dynamic Programming', 'Recursion', 'Memoization', 'C++']