Basics DP in Matrix || O(N^2)
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```cpp []\nclass Solution {\npublic:\n    int maxScore(vector<vector<int>>& grid) \n    {\n        ios::sync_with_stdio(false);\n        cin.tie(0);\n        int res = -1e8;\n        for (int i = 0; i < grid.size(); i++)\n        {\n            for (int j = 0; j < grid[0].size(); j++)\n            {\n                if (i == 0 && j == 0) continue;\n                res = max(max(res,grid[i][j] - (j==0?INT_MAX:grid[i][j-1])), grid[i][j] - (i==0?INT_MAX:grid[i-1][j]));\n                grid[i][j] = min(j==0?INT_MAX:grid[i][j-1], min(grid[i][j], i==0?INT_MAX:grid[i-1][j]));\n            }\n            cout << endl;\n        }\n        return res;\n    }\n};\n```
['C++']