标签:com bsp turn http etc ret nbsp 图片 loading
解:O(N)
class Solution: def maxScoreSightseeingPair(self, A: List[int]) -> int: left, res = A[0], -1 for j in range(1, len(A)): res = max(res, left + A[j] - j) left = max(left, A[j] + j) return res
标签:com bsp turn http etc ret nbsp 图片 loading
原文地址:https://www.cnblogs.com/oldby/p/13155382.html