DP || Recursion + Memoization || Super Simple || C++
Code
# Code
```cpp []
class Solution 
{
public:
    int m, n;
    int dp[501][501][3];
    int f(int r, int c, int rem, vector<vector<int>>& coins)
    {
        if(r>=m || c>=n) return INT_MIN;
        if(r==m-1 && c==n-1) 
        {
            if(rem>0 && coins[r][c]<0) return 0;
            return coins[r][c];
        }
        if(dp[r][c][rem]!=-1) return dp[r][c][rem];
        int ans=coins[r][c]+max(f(r,c+1,rem,coins), f(r+1,c,rem,coins));
        if(rem>0 && coins[r][c]<0) 
        {
            ans=max(ans,max(f(r,c+1,rem-1,coins), f(r+1,c,rem-1,coins)));
        }
        return dp[r][c][rem]=ans;
    }
    int maximumAmount(vector<vector<int>>& coins) 
    {
        memset(dp,-1,sizeof(dp));
        m=coins.size(), n=coins[0].size();
        return f(0,0,2,coins);
    }
};
```
['Dynamic Programming', 'Recursion', 'Memoization', 'C++']