Grid Game LeetCode solution in Python
1# Runtime: 2175 ms (Top 21.39%) | Memory: 30.5 MB (Top 29.48%)234class Solution:5def gridGame(self, g: List[List[int]]) -> int:6top, bottom, res = sum(g[0]), 0, math.inf7for g0, g1 in zip(g[0], g[1]):8top -= g09res = min(res, max(top, bottom))10bottom += g111return res