Python 3 || 8 lines, padded grid  || T/S: 86% / 61%
Here\'s the plan:\n1. We pad grid with a top-row and a left-column of inf to avoid checking for edge cases. (Illustrated below with input from Example 1)\n\n   
Here\'s the plan:\n1. We pad `grid` with a top-row and a left-column of `inf` to avoid checking for edge cases. (Illustrated below with input from *Example 1*)\n```\n        [inf, inf, inf, inf, inf]\n        [inf,  9,   5,   7,   3 ]\n        [inf,  8,   9,   6,   1 ]\n        [inf,  6,   7,  14,   3 ]\n        [inf,  2,   5,   3,   1 ]\n```\n2. We iterate through `grid` upper-left to bottom-right, and we use `grid` to keep track of the optimum scores:\n```\n        [inf, inf, inf, inf, inf]\n        [inf,  9,   5,   5,   3 ]\n        [inf,  8,   5,   5,   1 ]\n        [inf,  6,   5,   5,   1 ]\n        [inf,  2,   2,   2,   1 ]\n\n```\nCODE:\n```\nclass Solution:\n    def maxScore(self, grid: List[List[int]]) -> int:\n\n        ans, m, n = -inf, len(grid), len(grid[0])\n        grid = [[inf]*n] + grid\n        grid = [[inf]+row for row in grid]\n        # for row in grid: print(row)\n        \n        for row, col in product(range(m), range(n)):\n            mn = min(grid[row][col+1], grid[row+1][col])\n            ans = max(ans, grid[row+1][col+1] - mn)\n            grid[row+1][col+1] = min(grid[row+1][col+1], mn)\n         # for row in grid: print(row)\n        \n        return ans\n```\n[https://leetcode.com/problems/maximum-difference-score-in-a-grid/submissions/1257127827/](https://leetcode.com/problems/maximum-difference-score-in-a-grid/submissions/1257127827/)\n\n\n\nI could be wrong, but I think that time complexity is *O*(*MN*) and space complexity is *O*(*MN*), in which *M* ~ `m` and *N* ~ `n`.
['Python3']