c++ || tabular dp || O(m*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)$$ -->\nO(n*m)\n- Space complexity:\n<!-- Add your space complexity here, e.g. $$O(n)$$ -->\nO(n*m)\n# Code\n```\nclass Solution {\npublic:\n    \n    int maxScore(vector<vector<int>>& grid) {\n    int n=grid.size();\n    int m=grid[0].size();\n\n    vector<vector<int>>dp(n,vector<int>(m,-1e6));\n    vector<int>row(n,-1e6),col(m,-1e6);\n    row[0]=-grid[0][0];\n    col[0]=-grid[0][0];\n    for(int i=0;i<n;i++){\n        for(int j=0;j<m;j++){\n      \n        if(i==0 && j==0)\n        continue;\n\n            dp[i][j]= max(grid[i][j]+col[j],dp[i][j]);\n\n        col[j]=max(col[j],-grid[i][j] + (dp[i][j]>0 ?dp[i][j] :0 ));\n\n       \n            dp[i][j]= max(grid[i][j]+row[i],dp[i][j]);\n\n        row[i]=max(row[i],-grid[i][j] + (dp[i][j]>0 ?dp[i][j] :0 ));\n        \n        }\n    }\n    int ans=-1e8;\n    for(int i=0;i<n;i++){\n        for(int j=0;j<m;j++){\n            if(i==0 && j==0)\n            continue;\n       ans=max(dp[i][j],ans);\n        }\n    }\n    \nreturn ans;\n    }\n};\n```
['Dynamic Programming', 'Memoization', 'C++']