Clever problem... Its DP but required paperwork first
IntuitionAt first, substraction might be hard. I think about jump game first, as I need to try each cell in that cell/column that could move to the current cell
# Intuition
<!-- Describe your first thoughts on how to solve this problem. -->
At first, substraction might be hard. I think about jump game first, as I need to try each cell in that cell/column that could move to the current cell.

However, if we write the equation out:
    - we jump our path as c1,c2,c3 --> all values in the middle will cancel itself (-c1 + c2 + -c2 + c3) -> turns out it just -c1 + c3(first and last value)
    - With this, we just need to do prefSum template with minValue sofar ( could call this DP as prefSum just a specific DP type..?)
# 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
```python3 []
class Solution:
    def maxScore(self, grid: List[List[int]]) -> int:
        #m * n grid? - #DP for sure

        ROW, COL = len(grid), len(grid[0])
        maxVal = float("-inf")
        for c in range(1, COL):
            maxVal = max(maxVal, grid[0][c] - grid[0][c-1])
            grid[0][c] = min(grid[0][c-1], grid[0][c])
        for r in range(1, ROW):
            maxVal = max(maxVal, grid[r][0] - grid[r-1][0])
            grid[r][0] = min(grid[r-1][0], grid[r][0])
        
        for r in range(1, ROW):
            for c in range(1, COL):
                curBestChoice = grid[r][c] - min(grid[r-1][c], grid[r][c-1])
                maxVal = max(maxVal, curBestChoice)
                grid[r][c] = min(grid[r][c], grid[r-1][c], grid[r][c-1])
        
        return maxVal

        #either choose or not choose

        #Jump game?
        

```
['Python3']