Leetcode
2017. 网格游戏
class Solution:
    def gridGame(self, G: List[List[int]]) -> int:
        T = [0] + list(accumulate(G[0]))
        B = [0] + list(accumulate(G[1]))
        return min(max(T[len(T) - 1] - T[i], B[i-1]) for i in range(1, len(T)))
Leetcode 中等
阅读 32
2022-02-12
class Solution:
    def gridGame(self, G: List[List[int]]) -> int:
        T = [0] + list(accumulate(G[0]))
        B = [0] + list(accumulate(G[1]))
        return min(max(T[len(T) - 1] - T[i], B[i-1]) for i in range(1, len(T)))
相关推荐
精彩评论(0)